My original thread can be found at: https://www.planetdev.net/index.php?showtopic=507
Well I'm gonna start up with a high demand from people with the touch screen ability within Pokemon Essentials.
You will need the mouse module and the dualscreen script by Cng. And obviously Pokemon Essentials.
The first step you need to do is create a button graphic about 50X50 in size.
In a script you need to set up the sprite display for the button(Judging that most people will choose the menu script)
To set up the first button display you need to do the following code:
That sets up the button graphic for the first button
To set up the mouse part of the script as to where to click and where the mouse needs to be you need to find the loop do method of the script:
Do the following:
And that should be all you need to do in-order to set up the whole touch screen method. Just make sure you have set the button up properly with what it needs to do and check that you know exactly what to do within scripting before you try to do this.
Here's an example of a working button:
That is an example of a pokedex button.
Well that's it for now but I will add in extra tutorials in the near future.
Well I'm gonna start up with a high demand from people with the touch screen ability within Pokemon Essentials.
You will need the mouse module and the dualscreen script by Cng. And obviously Pokemon Essentials.
The first step you need to do is create a button graphic about 50X50 in size.
In a script you need to set up the sprite display for the button(Judging that most people will choose the menu script)
To set up the first button display you need to do the following code:
Code:
@button1=Sprite.new
@button1.x = # Change the # to the value of the displayed graphic's verticle appearance
@button1.y = # Change the # to the value of the displayed graphic's horizontal appearance
@button1.z = 100 # This sets the priority of the button over other graphics
@button1.bitmap = RPG::Cache.picture("insert graphic name here") # defines the graphic
That sets up the button graphic for the first button
To set up the mouse part of the script as to where to click and where the mouse needs to be you need to find the loop do method of the script:
Do the following:
Code:
if Mouse.mouse_in_area?(x,y,width,height) # change the x and y to the co-ordinates on screen change the width and height to the size of the graphic
if Mouse.click?(1) # checks if the left mouse button is clicked
#this is where you define the actions of the button
end
end
And that should be all you need to do in-order to set up the whole touch screen method. Just make sure you have set the button up properly with what it needs to do and check that you know exactly what to do within scripting before you try to do this.
Here's an example of a working button:
Code:
if Mouse.mouse_in_area?(21,353,60,39)
if Mouse.click?(1)
$game_system.se_play($data_system.decision_se)
pbFadeOutIn(99999) {
scene=PokemonPokedexScene.new
screen=PokemonPokedex.new(scene)
screen.pbStartScreen
}
end
end
That is an example of a pokedex button.
Well that's it for now but I will add in extra tutorials in the near future.