Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> Redd's Icons, Eye Candy
Redd
post Dec 9 2009, 02:30 PM
Post #1


:<
Group Icon

Group: Revolutionary
Posts: 2,315
Type: Developer
RM Skill: Advanced




There are 3 scripts here: TitleIcons, MenuIcons, and EndIcons. I'm working on getting these all put up in one big script, but until then they are separate.

What these basically do is make the Title Screen, Menu, and End Game screen have icons next to their words. You can customize the icons, by the way.

Put all of these above main and below any other scripts you might have

[Show/Hide] TitleIcons

See the top of the script for instructions
CODE
#==============================================================================
# ** Redd's TitleIcons
#==============================================================================
#  Gives the title screen the ability to have icons in the choices
#==============================================================================
#  Instructions
#
#  After configuring what you want your icons to be, go into Scene_Title, look
#  for line 40, and change
#  @command_window = Window_Command.new(192, [s1, s2, s3])
#  to...
#  @command_window = Window_TitleIcons.new(192, [s1, s2, s3])
#
#  And there you have it. If you need any support just email redredd@live.com
#==============================================================================

class Window_TitleIcons < Window_Command
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
      # Draw the icon associated with the index.
      draw_icon(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    # rect = Rect.new(x, y, width, height) Note the x is 32, not the default 4.
    rect = Rect.new(32, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # * Draw Icon
  #--------------------------------------------------------------------------
  def draw_icon(index)
    # Case index
    case index
    # Conditional branch happy.gif
    when 0
      # Sets the icon name (Case Sensitive)
      icon = '001-Weapon01'
    when 1
      icon = '035-Item04'
    when 2
      icon = '046-Skill03'
    # If there are more than 3 commands:
    else
      # Don't draw anything.
      icon = ''
    end
    # Create the bitmap image for the icon
    bitmap = RPG::Cache.icon(icon)
    # Make the rectangle for the image to be in
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    # Draw the bitmap inside the rectangle, at 4 pixels across,
    # and down according to the index
    self.contents.blt(4, 32*index+5, bitmap, src_rect)
  end
end

[Show/Hide] MenuIcons

See the top of the script for instructions
CODE
#==============================================================================
# ** Redd's MenuIcons
#==============================================================================
#  Gives the menu the ability to have icons in the choices
#==============================================================================
#  Instructions
#
#  After configuring what you want your icons to be, go into Scene_Title, look
#  for line 26, and change
#  @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
#  to...
#  @command_window = Window_MenuIcons.new(160, [s1, s2, s3, s4, s5, s6])
#
#  And there you have it. If you need any support just email redredd@live.com
#==============================================================================

class Window_MenuIcons < Window_Command
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
      # Draw the icon associated with the index.
      draw_icon(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    # rect = Rect.new(x, y, width, height) Note the x is 32, not the default 4.
    rect = Rect.new(32, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # * Draw Icon
  #--------------------------------------------------------------------------
  def draw_icon(index)
    # Case index
    case index
    # Conditional branch happy.gif
    when 0
      # Sets the icon name (Case Sensitive)
      icon = '032-Item01'
    when 1
      icon = '050-Skill07'
    when 2
      icon = '013-Body01'
    when 3
      icon = '040-Item09'
    when 4
      icon = '035-Item04'
    when 5
      icon = '046-Skill03'
    # If there are more than 6 commands:
    else
      # Don't draw anything.
      icon = ''
    end
    # Create the bitmap image for the icon
    bitmap = RPG::Cache.icon(icon)
    # Make the rectangle for the image to be in
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    # Draw the bitmap inside the rectangle, at 4 pixels across,
    # and down according to the index
    self.contents.blt(4, 32*index+5, bitmap, src_rect)
  end
end

[Show/Hide] EndIcons

See the top of the script for instructions
CODE
#==============================================================================
# ** Redd's EndIcons
#==============================================================================
#  Gives the ending screen the ability to have icons in the choices
#==============================================================================
#  Instructions
#
#  After configuring what you want your icons to be, go into Scene_End, look
#  for line 16, and change
#  @command_window = Window_Command.new(192, [s1, s2, s3])
#  to...
#  @command_window = Window_EndIcons.new(192, [s1, s2, s3])
#
#  And there you have it. If you need any support just email redredd@live.com
#==============================================================================

class Window_EndIcons < Window_Command
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
      # Draw the icon associated with the index.
      draw_icon(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    # rect = Rect.new(x, y, width, height) Note the x is 32, not the default 4.
    rect = Rect.new(32, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # * Draw Icon
  #--------------------------------------------------------------------------
  def draw_icon(index)
    # Case index
    case index
    # Conditional branch happy.gif
    when 0
      # Sets the icon name (Case Sensitive)
      icon = '048-Skill05'
    when 1
      icon = '046-Skill03'
    when 2
      icon = '036-Item05'
    # If there are more than 3 commands:
    else
      # Don't draw anything.
      icon = ''
    end
    # Create the bitmap image for the icon
    bitmap = RPG::Cache.icon(icon)
    # Make the rectangle for the image to be in
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    # Draw the bitmap inside the rectangle, at 4 pixels across,
    # and down according to the index
    self.contents.blt(4, 32*index+5, bitmap, src_rect)
  end
end

Hope you like them. No need to give credit. They were really simple to make.

If you want me to put icons in a custom menu/title/whatever script, just ask smile.gif

Ultra thanks to Night_Runner for making the tutorial on how to do this... at least part of it.

EDIT: Here's the whole thing put together in one script:
[Show/Hide] All-In-One

CODE
#==============================================================================
# ** Redd's TitleIcons
#==============================================================================
#  Gives the title screen the ability to have icons in the choices
#==============================================================================
#  Instructions
#
#  After configuring what you want your icons to be, go into Scene_Title, look
#  for line 40, and change
#  @command_window = Window_Command.new(192, [s1, s2, s3])
#  to...
#  @command_window = Window_TitleIcons.new(192, [s1, s2, s3])
#
#  And there you have it. If you need any support just email redredd@live.com
#==============================================================================

class Window_TitleIcons < Window_Command
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
      # Draw the icon associated with the index.
      draw_icon(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    # rect = Rect.new(x, y, width, height) Note the x is 32, not the default 4.
    rect = Rect.new(32, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # * Draw Icon
  #--------------------------------------------------------------------------
  def draw_icon(index)
    # Case index
    case index
    # Conditional branch happy.gif
    when 0
      # Sets the icon name (Case Sensitive)
      icon = '001-Weapon01'
    when 1
      icon = '035-Item04'
    when 2
      icon = '046-Skill03'
    # If there are more than 3 commands:
    else
      # Don't draw anything.
      icon = ''
    end
    # Create the bitmap image for the icon
    bitmap = RPG::Cache.icon(icon)
    # Make the rectangle for the image to be in
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    # Draw the bitmap inside the rectangle, at 4 pixels across,
    # and down according to the index
    self.contents.blt(4, 32*index+5, bitmap, src_rect)
  end
end
#==============================================================================
# ** Redd's MenuIcons
#==============================================================================
#  Gives the menu the ability to have icons in the choices
#==============================================================================
#  Instructions
#
#  After configuring what you want your icons to be, go into Scene_Title, look
#  for line 26, and change
#  @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
#  to...
#  @command_window = Window_MenuIcons.new(160, [s1, s2, s3, s4, s5, s6])
#
#  And there you have it. If you need any support just email redredd@live.com
#==============================================================================

class Window_MenuIcons < Window_Command
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
      # Draw the icon associated with the index.
      draw_icon(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    # rect = Rect.new(x, y, width, height) Note the x is 32, not the default 4.
    rect = Rect.new(32, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # * Draw Icon
  #--------------------------------------------------------------------------
  def draw_icon(index)
    # Case index
    case index
    # Conditional branch happy.gif
    when 0
      # Sets the icon name (Case Sensitive)
      icon = '032-Item01'
    when 1
      icon = '050-Skill07'
    when 2
      icon = '013-Body01'
    when 3
      icon = '040-Item09'
    when 4
      icon = '035-Item04'
    when 5
      icon = '046-Skill03'
    # If there are more than 6 commands:
    else
      # Don't draw anything.
      icon = ''
    end
    # Create the bitmap image for the icon
    bitmap = RPG::Cache.icon(icon)
    # Make the rectangle for the image to be in
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    # Draw the bitmap inside the rectangle, at 4 pixels across,
    # and down according to the index
    self.contents.blt(4, 32*index+5, bitmap, src_rect)
  end
end
#==============================================================================
# ** Redd's EndIcons
#==============================================================================
#  Gives the ending screen the ability to have icons in the choices
#==============================================================================
#  Instructions
#
#  After configuring what you want your icons to be, go into Scene_End, look
#  for line 16, and change
#  @command_window = Window_Command.new(192, [s1, s2, s3])
#  to...
#  @command_window = Window_EndIcons.new(192, [s1, s2, s3])
#
#  And there you have it. If you need any support just email redredd@live.com
#==============================================================================

class Window_EndIcons < Window_Command
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
      # Draw the icon associated with the index.
      draw_icon(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    # rect = Rect.new(x, y, width, height) Note the x is 32, not the default 4.
    rect = Rect.new(32, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # * Draw Icon
  #--------------------------------------------------------------------------
  def draw_icon(index)
    # Case index
    case index
    # Conditional branch happy.gif
    when 0
      # Sets the icon name (Case Sensitive)
      icon = '048-Skill05'
    when 1
      icon = '046-Skill03'
    when 2
      icon = '036-Item05'
    # If there are more than 3 commands:
    else
      # Don't draw anything.
      icon = ''
    end
    # Create the bitmap image for the icon
    bitmap = RPG::Cache.icon(icon)
    # Make the rectangle for the image to be in
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    # Draw the bitmap inside the rectangle, at 4 pixels across,
    # and down according to the index
    self.contents.blt(4, 32*index+5, bitmap, src_rect)
  end
end


__________________________
Go to the top of the page
 
+Quote Post
   
Bio Wolfz
post Dec 10 2009, 05:59 PM
Post #2


Blinded Assassin
Group Icon

Group: Revolutionary
Posts: 164
Type: Mapper
RM Skill: Intermediate




lol, i already know how to put icons in menu and title biggrin.gif but anyway cool very simple but nice isn't there a tutorial which teaches you how to put icon?
Go to the top of the page
 
+Quote Post
   
Bigace
post Dec 12 2009, 11:20 AM
Post #3


The King of Spades
Group Icon

Group: Revolutionary
Posts: 400
Type: Developer
RM Skill: Intermediate




Nice script, but what about the window height.
Something like this was forgotten, unless I'm missing something:
CODE
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     width    : window width
  #     commands : command text string array
  #--------------------------------------------------------------------------
  def initialize(width, commands)
    # Compute window height from command quantity
    super(0, 0, width, commands.size * 32 + 32)
    @item_max = commands.size
    @commands = commands
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    refresh
    self.index = 0
  end


So it looks like this:
Attached File  menu.png ( 129.33K ) Number of downloads: 128


But when I try to imput it this comes up:
Attached File  error.png ( 14.29K ) Number of downloads: 29


I'm no scriptor yet so this is why I can't figure out why this is happening.


__________________________



Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

QUOTE ('Exiled One')
"If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others."
Go to the top of the page
 
+Quote Post
   
Redd
post Dec 13 2009, 06:07 PM
Post #4


:<
Group Icon

Group: Revolutionary
Posts: 2,315
Type: Developer
RM Skill: Advanced




Well, that's not my fault. You have lots of other menu addons, causing it to overlap.
What I would do is this:

Go to Scene_Menu
Find line 26
Change
CODE
@command_window = Window_MenuIcons.new(160, [s1, s2, s3, s4, s5, s6])

To
CODE
@command_window = Window_MenuIcons.new(160, [s1, s2, s3, s4, s5])


What this will do is remove End Game from the menu screen. You cannot remove any of the other strings (the 's') because it would result in strange things, like if you chose to take out s5 (save game) and not s6 (end game), then when you clicked End Game it would instead go to the saving screen. To resizing the window would do you no good, since it would chop off all of the other text.
Sorry.

EDIT: another reason why this could be happening is because you have the Album option.
This would've happened before you got the icons though, so... yeah.
This isn't creating a full on new window for the text to be inside of, only the icons, which means I don't really need length or width for a window or whatever.

Point is, it works fine on the normal menu window.

@Bio Wolfz
Yes. There is a tutorial. I'm just making it much simpler for everyone.
There must have been one big tutorial from the start, right?
And anyways, it's a very simple script that has been done lots of times.


__________________________
Go to the top of the page
 
+Quote Post
   
Bigace
post Dec 13 2009, 06:22 PM
Post #5


The King of Spades
Group Icon

Group: Revolutionary
Posts: 400
Type: Developer
RM Skill: Intermediate




QUOTE (Redd @ Dec 13 2009, 09:07 PM) *
Well, that's not my fault. You have lots of other menu addons, causing it to overlap.
What I would do is this:

Go to Scene_Menu
Find line 26
Change
CODE
@command_window = Window_MenuIcons.new(160, [s1, s2, s3, s4, s5, s6])

To
CODE
@command_window = Window_MenuIcons.new(160, [s1, s2, s3, s4, s5])


What this will do is remove End Game from the menu screen. You cannot remove any of the other strings (the 's') because it would result in strange things, like if you chose to take out s5 (save game) and not s6 (end game), then when you clicked End Game it would instead go to the saving screen. To resizing the window would do you no good, since it would chop off all of the other text.
Sorry.

EDIT: another reason why this could be happening is because you have the Album option.
This would've happened before you got the icons though, so... yeah.
This isn't creating a full on new window for the text to be inside of, only the icons, which means I don't really need length or width for a window or whatever.

Point is, it works fine on the normal menu window.

@Bio Wolfz
Yes. There is a tutorial. I'm just making it much simpler for everyone.
There must have been one big tutorial from the start, right?
And anyways, it's a very simple script that has been done lots of times.


Well if that's the case then I can't use this script. dry.gif


__________________________



Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

QUOTE ('Exiled One')
"If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others."
Go to the top of the page
 
+Quote Post
   
Redd
post Dec 13 2009, 06:54 PM
Post #6


:<
Group Icon

Group: Revolutionary
Posts: 2,315
Type: Developer
RM Skill: Advanced




Hm... that sucks. What you could also do is to take out Steps (who needs to know how many steps they've taken?) and move all of the windows down. That would fix the problem.

Could you also tell me where you found that Game Progress script? It's really cool biggrin.gif


__________________________
Go to the top of the page
 
+Quote Post
   
Bigace
post Dec 13 2009, 07:15 PM
Post #7


The King of Spades
Group Icon

Group: Revolutionary
Posts: 400
Type: Developer
RM Skill: Intermediate




QUOTE (Redd @ Dec 13 2009, 09:54 PM) *
Hm... that sucks. What you could also do is to take out Steps (who needs to know how many steps they've taken?) and move all of the windows down. That would fix the problem.

It's all right, I took out the Icon thing from the The Law G14's Menu Scene and modded to where the menu doesn't stretch because it did the same thing yours did. But all I did was change one line and I got it.

QUOTE (Redd @ Dec 13 2009, 09:54 PM) *
Could you also tell me where you found that Game Progress script? It's really cool biggrin.gif


I can PM you the script for it, I had to customize the Scene_Menu to fit it but I have to find the demo where came from and I think I got from the Creation Asylum site. However I can still strip it from my game and PM you it and I'll give you the demo later, maybe theres stuff in there may like aswell.


__________________________



Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

QUOTE ('Exiled One')
"If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others."
Go to the top of the page
 
+Quote Post
   
Redd
post Dec 19 2009, 02:03 PM
Post #8


:<
Group Icon

Group: Revolutionary
Posts: 2,315
Type: Developer
RM Skill: Advanced




That would be great man. Thanks!

Okay, kinda straying off topic here. Anything else?


__________________________
Go to the top of the page
 
+Quote Post
   
Fixxxer4153
post Feb 5 2010, 03:34 PM
Post #9


Level 10
Group Icon

Group: Revolutionary
Posts: 155
Type: Developer
RM Skill: Beginner




I don't know if anyone will check this post, but I saw this and it reminded me of something similar I wanted to do. Unfortunately I cannot script anything... whatsoever, and I was hoping since this had been done it might be possible to do this as well:

Instead of placing icons in a title screen or menu or anything like that, I was wondering if it might be possible to display icons with a set of choices... say for example in-game you're asked what style of hair or what color eyes you want, sort of an event-based character creation process where you are given several choices, and next to each choice is an icon of what that decision represents.

Its not extremely important and if it would be too much work for a scripter to define a script to realize when a particular set of choices comes up to display an icon next to each choice giving the player a visual of their decision... well i guess that's up to the scripter in any case.

I'm just wondering how much work it would take to do, and if anyone has already made that kind of script?


__________________________
"Then it comes to be that the soothing light at the end of your tunnel... is just a freight train comin' your way..."


Which Final Fantasy Character Are You?
Final Fantasy 7
Go to the top of the page
 
+Quote Post
   
Redd
post Feb 15 2010, 06:12 PM
Post #10


:<
Group Icon

Group: Revolutionary
Posts: 2,315
Type: Developer
RM Skill: Advanced




You could get ccoa's UMS for that. Very easy to do and a lot more features than just that. Google it. It's a great message system.


__________________________
Go to the top of the page
 
+Quote Post
   
Arcx500
post Jan 5 2011, 11:29 AM
Post #11



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Undisclosed




I just added this script and for some reason, I can't see the icons.
And uh... is it normal that I see emotes in the code text? What do I have to put instead of the happy smile? ^^

Edit : Sorry, I didn't read the parts where I had to change some lines in Scene_x

Great script, been looking for ages for something like this. <3
Think you can also make a script to add icons to STR, DEX, AGI and stuff in the status window?

This post has been edited by Arcx500: Jan 6 2011, 05:07 PM
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 26th May 2013 - 12:19 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker