Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Some help With my Script!

I'm making a Small (And cool XD) script :D
this is one of its windows but the Text dosen't work... so my question is WHY?!
I hope someone can help!
Code:
class Slot < Window_Base
  attr_accessor :id
  attr_accessor :type
  attr_accessor :icon_x
  attr_accessor :icon_y
  def initialize(x,y)
    super(x, y, 35, 35)
    self.contents = Bitmap.new(width - 32, height - 32)
    @id = 0
    @type = 0
    @icon_x = 0
    @icon_y = 0
    start
  end
  def start
    if @id != 0 and @id != nil and @type != 0 and @type != nil and @type <= 3
        if @type == 1
          @icon = RPG::Cache.icon($icon_1)
        elsif @type == 2
          @icon = RPG::Cache.icon($icon_2)
        elsif @type == 3
          @icon = RPG::Cache.icon($icon_3)
        end
        @Slot_icon = Sprite.new 
        @Slot_icon.bitmap = @icon
        @Slot_icon.x = self.x + (@icon.width/4)
        @Slot_icon.y = self.y + (@icon.height/4)
        @Slot_icon.z = 500000
    end
  end
  
  def update
    self.contents.clear
    self.contents.font.size = 13
    self.contents.draw_text(0, 0, 10, 10, "N")
  end
end

http://img511.imageshack.us/img511/6486/nowwp8.png[/IMG]
 
I don't think it's big enough to show the letter
Does this work? (it did for me)
Code:
class Slot < Window_Base
  attr_accessor :id
  attr_accessor :type
  attr_accessor :icon_x
  attr_accessor :icon_y
  def initialize(x,y)
    super(x, y, 40, 45)
    self.contents = Bitmap.new(width - 32, height - 32)
    @id = 0
    @type = 0
    @icon_x = 0
    @icon_y = 0
    start
  end
  def start
    if @id != 0 and @id != nil and @type != 0 and @type != nil and @type <= 3
        if @type == 1
          @icon = RPG::Cache.icon($icon_1)
        elsif @type == 2
          @icon = RPG::Cache.icon($icon_2)
        elsif @type == 3
          @icon = RPG::Cache.icon($icon_3)
        end
        @Slot_icon = Sprite.new 
        @Slot_icon.bitmap = @icon
        @Slot_icon.x = self.x + (@icon.width/4)
        @Slot_icon.y = self.y + (@icon.height/4)
        @Slot_icon.z = 500000
    end
  end
  
  def update
    self.contents.clear
    self.contents.font.size = 13
    self.contents.draw_text(0, 0, 15, 15, "N")
  end
end
 
I will try to help ^^'

Making a window with size 35x35 it's small because...

Code:
def initialize(x,y)
    super(x, y, 35, 35)
    self.contents = Bitmap.new(width - 32, height - 32)

See? You decrease 32 pixels for the borders
And you end with just 3 pixels for the contents o.o
Use a value for Width and Height that when it be decreased do not affect what will be wrote inside ^^

I think that... nearly 40 pixels to both Width and Height could be ok
But you have to be 'trying' the values untill reach the one that fits you purpose ^^

I hope this help you!
Bye and good luck with the Script ^^
 

Anonymous

Guest

Help me ....

I have Demo RPGXP Online . It Use Neplay v6 . But I can't Play online with another computer . I online only with me , ....

Help me. I wish you share to me hostfree , up Netplay v6...

This Picture of myDemo

.....This is title

http://i55.photobucket.com/albums/g122/ ... 06/1-2.jpg[/IMG]


This is Login

http://i55.photobucket.com/albums/g122/ ... 2006/2.jpg[/IMG]

My Game :

http://i55.photobucket.com/albums/g122/ ... 2006/3.jpg[/IMG]

http://i83.photobucket.com/albums/j307/ ... /multi.jpg[/IMG]

http://i83.photobucket.com/albums/j307/ ... etplay.jpg[/IMG]


helpme.............................
 
Reaper*;255771 said:
Just use a picture instead of a window this will solve you problem.

(Call a picture in you script with the directions you want it you should know how)

Very Smart thanks!

Help me ....

I have Demo RPGXP Online . It Use Neplay v6 . But I can't Play online with another computer . I online only with me , ....

Help me. I wish you share to me hostfree , up Netplay v6...

This Picture of myDemo

Make a new Thread!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top