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.

Window selectable>Picture

I have seen this somewhere, but with the Menu screen. I Just need a script that makes in when you have a certain Choice Selected It will display a picture.

For example. When the 'Yes' is highlightd, a picture of a smiley face will be displayed. and when 'No' is highlighted, and picture of a frowney face will be displayed. This will help extreemly on my project.

Thanks in advance.
 
With most message scripts, you can make the face an icon then simply insert a code into each choice... but I don't know if they'd disappear when the other choice was selected or if they'd just stay there.
 
are you talking about a message or a custom script?
i mean...if you want it into a message, then i don't know but if you're selecting yes and no from a script, then you should use Bitmap.new
what are you trying to do?
 
use
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture('Image_yes')

and then under update,
use
if @command_window.index == 0
@sprite.bitmap = RPG::Cache.picture('Image_Yes')
else if @command_window.index == 1
@sprite.bitmap = RPG::Cache.picture('Image_No')
end
end
 
no, inside you scene, when you set the background, put @sprite = Sprite.new
and @sprite.bitmap....etc.
and under update, maybe you should use
while @command_window.index == 0
@sprite.bitmap ....
else
@sprite.bitmap...
end
and it should work =)

aww...2 pages and you still don't understand, i must suck at explanaitions...
well...i did this script, to make it easier

#==============================================================================
# ** Scene_AreoX
#------------------------------------------------------------------------------
# This Scene was made for AreoX
#==============================================================================

class Scene_AreoX
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture('Image_yes')
s1 = "Yes"
s2 = "No"
@command_window = Window_Command.new(150, [s1, s2])
@command_window.x = 400
@command_window.y = 240 - @command_window.height / 2
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame Update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of window
@command_window.dispose
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window.update
# Evaluates and change the image depending on what index is the cursor over
if @command_window.index == 0
@sprite.bitmap = RPG::Cache.picture('Image_yes')
else if @command_window.index == 1
@sprite.bitmap = RPG::Cache.picture('Image_no')
end
end
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to Map Screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # to map
command_yes
when 1 # to map
command_no
end
return
end
end
#--------------------------------------------------------------------------
# * Process When Choosing [yes] Command
#--------------------------------------------------------------------------
def command_yes
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Fade out BGM, BGS, and ME
# Switch to title screen
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Process When Choosing [no] Command
#--------------------------------------------------------------------------
def command_no
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Fade out BGM, BGS, and ME
# Shutdown
$scene = Scene_Map.new
#--------------------------------------------------------------------------
end
#--------------------------------------------------------------------------
you must have 2 images, inside "Pictures" folder, and one must be called Image_yes (when you are over yes) and one called Image_no (when over no XD)

hope it helps.

how to call it?
paste above main.
then make a new event, go to third page, select call script, and put $scene = Scene_AreoX.new
then start game and test it =)
 

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