Evilupstart
Member
Hi, i'm trying to learn how to script by a simple process of cutting and pasting snippits of code around a scene i've created. I'm having a little trouble though (which i guess can be expected).
I'm using AWorks Input and MouseInput scripts to create a simple menu image that pops up and displays pictures. No 'windows' as such. When I use a mouse-over to determine if some text should display at a given location on the screen it does, however it doesnt disappear when I move the mouse off the location... still with me?
Here's a screen showing the mish-mash of text.
Here's a look at the code, please don't rip into me for any faux pas in the scripting, im not a scripter. I'm trying to learn.
my problem is with the last set of elsif commands they display the text but they dont delete it afterwards, so i get a mush of text at the bottom of my screen. All I want to know is how to make the text disappear after the mouse moves off the icon.
And yes, I'm trying to re-create the menu from Borderlands.
I'm using AWorks Input and MouseInput scripts to create a simple menu image that pops up and displays pictures. No 'windows' as such. When I use a mouse-over to determine if some text should display at a given location on the screen it does, however it doesnt disappear when I move the mouse off the location... still with me?
Here's a screen showing the mish-mash of text.
Here's a look at the code, please don't rip into me for any faux pas in the scripting, im not a scripter. I'm trying to learn.
Code:
class Scene_Alt_Menu
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture("men_back_char")
# Execute transition
Graphics.transition(5)
# Main loop
while $scene == self
Graphics.update
Input.update
update
end
# Prepare for transition
Graphics.freeze
@sprite.bitmap.dispose
@sprite.dispose
# Execute transition
Graphics.transition(5)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
menchar = Input.mouse_in_area?(341, 13, 32, 32)
menpack = Input.mouse_in_area?(378, 13, 32, 32)
menabil = Input.mouse_in_area?(416, 13, 32, 32)
menally = Input.mouse_in_area?(452, 13, 49, 32)
menmiss = Input.mouse_in_area?(506, 13, 25, 32)
if menchar and Input.trigger?(Input::MOUSE_PRIMARY)
$game_system.se_play($data_system.decision_se)
@sprite.bitmap = RPG::Cache.picture("men_back_char")
elsif menpack and Input.trigger?(Input::MOUSE_PRIMARY)
$game_system.se_play($data_system.decision_se)
@sprite.bitmap = RPG::Cache.picture("men_back_pack")
elsif menabil and Input.trigger?(Input::MOUSE_PRIMARY)
$game_system.se_play($data_system.decision_se)
@sprite.bitmap = RPG::Cache.picture("men_back_abil")
elsif menally and Input.trigger?(Input::MOUSE_PRIMARY)
$game_system.se_play($data_system.decision_se)
@sprite.bitmap = RPG::Cache.picture("men_back_ally")
elsif menmiss and Input.trigger?(Input::MOUSE_PRIMARY)
$game_system.se_play($data_system.decision_se)
@sprite.bitmap = RPG::Cache.picture("men_back_miss")
end
if menchar
@sprite.bitmap.draw_text(124, 410, 420, 32, 'Click for Character Info', 1)
elsif menpack
@sprite.bitmap.draw_text(124, 410, 420, 32, 'Click for Backpack Info', 1)
elsif menabil
@sprite.bitmap.draw_text(124, 410, 420, 32, 'Click for Abilities Info', 1)
elsif menally
@sprite.bitmap.draw_text(124, 410, 420, 32, 'Click for Allies Info', 1)
elsif menmiss
@sprite.bitmap.draw_text(124, 410, 420, 32, 'Click for Missions Info', 1)
else
@sprite.bitmap.draw_text(124, 410, 420, 32, ' ', 1)
end
# If TAB button was pressed
if Input.press?(Keys::TAB)
# Switch to map screen
$scene = Scene_Map.new
end
end
end
And yes, I'm trying to re-create the menu from Borderlands.