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.

Underlining font

topman

Member

I am having a problem with underlining font in my menu, here is part of the window code.

Code:
def initialize
    super(0, 0, 320,380)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 22
    self.contents.font.bold = false
    self.contents.font.color = text_color(0)
    self.contents.draw_text(90, 0, 150, 33, "Initial party")
    end

It all works fine, but I can't get it to underline, here is the line I tried.

Code:
self.contents.font.underline = true

Any help would be appreciated, thanks.
 

khmp

Sponsor

Place that line right above where you make your draw_text call.

Code:
def initialize
    super(0, 0, 320,380)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 22
    self.contents.font.bold = false
    self.contents.font.color = text_color(0)
    self.contents.font.underline = true
    self.contents.draw_text(90, 0, 150, 33, "Initial party")
end

Are you using MACL?
 

khmp

Sponsor

Well I'm not sure about it because it runs on your pc right but no underline? Which means the syntax is legal. I know the MACL has additional things like underline added to the font class which will give you the underline effect among other things. That aside I have it installed and the underline works. I would recommend snagging it.

http://i229.photobucket.com/albums/ee31 ... erline.jpg[/IMG]

Code:
class Custom_Window < Window_Base
  def initialize
    super(0, 0, 320,380)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 22
    self.contents.font.bold = false
    self.contents.font.color = text_color(0)
    self.contents.font.underline = true
    self.contents.draw_text(90, 0, 150, 33, "Initial party")
  end
  
  def dispose
    self.contents.dispose
    super
  end
end
 

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