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.

Ruby Code Wrap?

I just got a kool idea. Since this is an "RMXP" forum, it would be kool if we had a Ruby Code wrap. VB/C#/C++ forums have it and i daupt it would be hard if you know php.

[Ruby][/Ruby]

Just look for key words like "class", "def", comments and change their colors. I know PHP but I don't know how to read the words in Wraps':| .
 
Nice, i like the idea a lot... Maybe some of the mods have thought about that, but they´re still attempting a way to implement this.... (Obvious, here we only talk about Ruby. We have PHP and HTML code wraps but not a Ruby wrap =/)
 

Anonymous

Guest

Well, if someone wanted to figure this out, it would be cool, I guess. I'm sorry, but I don't have the time to implement something that's basically eye candy right now. :-/
 
As ccoa said, it's not all that important, and is purely for aesthetics, but if it's really that important to you...

Code:
[color=green]#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
#  This window displays amount of gold.
#==============================================================================[/color]

[color=blue]class[/color] Window_Gold [color=#00A2EE]<[/color] Window_Base
  [color=green]#--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------[/color]
[color=blue]  def[/color] initialize
[color=blue]    super[/color][color=#00A2EE]([color=darkred]0[/color], [color=darkred]0[/color], [color=darkred]160[/color], [color=darkred]64[/color])[/color]
[color=blue]    self[/color][color=#00A2EE].[/color]contents [color=#00A2EE]=[/color] Bitmap.new[color=#00A2EE]([/color]width [color=#00A2EE]-[/color] [color=darkred]32[/color][color=#00A2EE],[/color] height [color=#00A2EE]-[/color] [color=darkred]32[/color][color=#00A2EE])[/color]
    refresh
[color=blue]  end[/color]
  [color=green]#--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------[/color]
  [color=blue]def[/color] refresh
    [color=blue]self[/color][color=#00A2EE].[/color]contents[color=#00A2EE].[/color]clear
    cx = contents.text_size($data_system.words.gold).width
    [color=blue]self[/color][color=#00A2EE].[/color]contents[color=#00A2EE].[/color]font[color=#00A2EE].[/color]color [color=#00A2EE]=[/color] normal_color
    [color=blue]self[/color][color=#00A2EE].[/color]contents[color=#00A2EE].[/color]draw_text[color=#00A2EE]([/color][color=darkred]4[/color][color=#00A2EE],[/color] [color=darkred]0[/color][color=#00A2EE],[/color] [color=darkred]120[/color][color=#00A2EE]-[color=black]cx[/color]-[color=darkred]2[/color],[/color] [color=darkred]32[/color][color=#00A2EE],[/color] $game_party[color=#00A2EE].[/color]gold[color=#00A2EE].[/color]to_s[color=#00A2EE],[/color] [color=darkred]2[/color][color=#00A2EE])[/color]
    [color=blue]self[/color][color=#00A2EE].[/color]contents[color=#00A2EE].[/color]font[color=#00A2EE].[/color]color [color=#00A2EE]=[/color] system_color
    [color=blue]self[/color][color=#00A2EE].[/color]contents[color=#00A2EE].[/color]draw_text[color=#00A2EE]([/color][color=darkred]124[/color][color=#00A2EE]-[/color]cx[color=#00A2EE],[/color] [color=darkred]0[/color][color=#00A2EE],[/color] cx[color=#00A2EE],[/color] [color=darkred]32[/color][color=#00A2EE],[/color] $data_system[color=#00A2EE].[/color]words[color=#00A2EE].[/color]gold[color=#00A2EE],[/color] [color=darkred]2[/color][color=#00A2EE])[/color]
[color=blue]  end[/color]
[color=blue]end[/color]

...Notepad has this great new feature called find and replace.
 
How the heck did you do that with find and replace? Am i missing something?

Also, its not important, I just thaught it would be kool.
 
Oh code...

[ruby]class This_Rocks
def initialize
print "coolness"
end
end[/ruby]

NVM.. you just BBCoded the code tag...

Code:
[color=green]#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
#  This window displays amount of gold.
#==============================================================================[/color]

[color=blue]class[/color] Window_Gold [color=#00A2EE]<[/color] Window_Base
  [color=green]#--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------[/color]
[color=blue]  def[/color] initialize
[color=blue]    super[/color][color=#00A2EE]([color=darkred]0[/color], [color=darkred]0[/color], [color=darkred]160[/color], [color=darkred]64[/color])[/color]
[color=blue]    self[/color][color=#00A2EE].[/color]contents [color=#00A2EE]=[/color] Bitmap.new[color=#00A2EE]([/color]width [color=#00A2EE]-[/color] [color=darkred]32[/color][color=#00A2EE],[/color] height [color=#00A2EE]-[/color] [color=darkred]32[/color][color=#00A2EE])[/color]
    refresh
[color=blue]  end[/color]
  [color=green]#--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------[/color]
  [color=blue]def[/color] refresh
    [color=blue]self[/color][color=#00A2EE].[/color]contents[color=#00A2EE].[/color]clear
    cx = contents.text_size($data_system.words.gold).width
    [color=blue]self[/color][color=#00A2EE].[/color]contents[color=#00A2EE].[/color]font[color=#00A2EE].[/color]color [color=#00A2EE]=[/color] normal_color
    [color=blue]self[/color][color=#00A2EE].[/color]contents[color=#00A2EE].[/color]draw_text[color=#00A2EE]([/color][color=darkred]4[/color][color=#00A2EE],[/color] [color=darkred]0[/color][color=#00A2EE],[/color] [color=darkred]120[/color][color=#00A2EE]-[color=black]cx[/color]-[color=darkred]2[/color],[/color] [color=darkred]32[/color][color=#00A2EE],[/color] $game_party[color=#00A2EE].[/color]gold[color=#00A2EE].[/color]to_s[color=#00A2EE],[/color] [color=darkred]2[/color][color=#00A2EE])[/color]
    [color=blue]self[/color][color=#00A2EE].[/color]contents[color=#00A2EE].[/color]font[color=#00A2EE].[/color]color [color=#00A2EE]=[/color] system_color
    [color=blue]self[/color][color=#00A2EE].[/color]contents[color=#00A2EE].[/color]draw_text[color=#00A2EE]([/color][color=darkred]124[/color][color=#00A2EE]-[/color]cx[color=#00A2EE],[/color] [color=darkred]0[/color][color=#00A2EE],[/color] cx[color=#00A2EE],[/color] [color=darkred]32[/color][color=#00A2EE],[/color] $data_system[color=#00A2EE].[/color]words[color=#00A2EE].[/color]gold[color=#00A2EE],[/color] [color=darkred]2[/color][color=#00A2EE])[/color]
[color=blue]  end[/color]
[color=blue]end[/color]

...Notepad has this great new feature called find and replace.[/QUOTE]
 
Shark_Tooth":1pnox01z said:
How the heck did you do that with find and replace? Am i missing something?

Also, its not important, I just thaught it would be kool.

Yeah, just figure that periods (.'s) commas, equals signs and parentheses all get one color (so find, for example "=" and replace with "="), then 'class,' 'def,' 'self,' and 'end' all get another color... and just keep doing that. It takes like... a minute or two.

Back in my day we didn't have no fancy-pants [ruby] tags, con flabbit.
 

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