Double Tapping (Selecting and Deciding)

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
I am manually using TouchInput for a custom image, where if I click that custom image, it would select that image with a certain command. Here's how I did it:

if(TouchInput.isTriggered() && TouchInput._x > Graphics.width / 2 - 100 && TouchInput._x < Graphics.width / 2 + 100 && TouchInput._y > 440 && TouchInput._y < 480) { SoundManager.playCursor(); this._commandWindow._index = 0; }However, when say I do this:

if(TouchInput.isTriggered() && TouchInput._x > Graphics.width / 2 - 100 && TouchInput._x < Graphics.width / 2 + 100 && TouchInput._y > 440 && TouchInput._y < 480) { SoundManager.playCursor(); this._commandWindow._index = 0; DataManager.setupNewGame(); this._commandWindow.close(); this.fadeOutAll(); SceneManager.goto(Scene_Map); }we all know that when you click the image, it directly puts you on the new game and transfer you on map. Note that I hid the title command and placed them somewhere else, and an image represents them. However, in a normal command, we select the command first, click it again before it gets selected. I want to do that here.

How do you exactly click the image, set the command, and wait till you click it again before it executes the other methods?
 

Amuseum

Veteran
Veteran
Joined
Oct 27, 2015
Messages
71
Reaction score
66
First Language
English Chinese
Primarily Uses
RMXP
there is no need to touch TouchInput. instead, create a button from the Sprite_Button class and add it the window. then set its callback:

Code:
button.setClickHandler(this.someFunction.bind(this, i));
look into Window_ShopNumber to see how they do it.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top