Galv's Screen Buttons

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,186
Reaction score
1,144
First Language
English
Primarily Uses
N/A

Screen Buttons - Version 1.3
RPG Maker MV Plugin
Galv



Introduction
Screen buttons for clicking and touching.


Screenshot



Features
Add buttons to the screen on specified or all maps that can be set to emulate button presses, run script code or run a common event (press and hold or triggered). Create or remove any number of buttons during the game.Includes a setting to disable map mouse-click movement if you wish to use buttons for arrow keys (example in demo).Can enable/disable buttons during game or have buttons disappear or stay during events such as ‘Show Text’ dialogue.Keyboard can not control these buttons, they are for mouse or touch activation only.


How to Use
- Copy the "Galv_ScreenButtons.js" file into your project's /js/plugins/ folder.- Activate plugin using the 'Plugin Manager'- Read the help file and examine the demo to learn how it works


Plugin
Get it here


Credit and Thanks
- Galv


Terms
Free to use in any RPG Maker MV project including commercial. Please credit "Galv". :)


Updates


2017-01-06 - Version 1.3 - fixed a bug with mouse move not disabled and no button in index 0


2016-12-15 - Version 1.2 - fixed a bug I created when fixing last bug when dragging off of a pressed button.


2016-12-13 - Version 1.1 - fixed a bug with mobile touch going into menus
2016-11-30 - Version 1.0 - release 
 
Last edited by a moderator:

Legendarios

Warper
Member
Joined
Dec 15, 2016
Messages
4
Reaction score
0
First Language
Spanish
Primarily Uses
Can it show the buttons also in the menu? I would like to display a Cancel button on the menu.
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,186
Reaction score
1,144
First Language
English
Primarily Uses
N/A
Not at the moment, sorry - only on maps.
 

TheChilliPL

Villager
Member
Joined
Dec 6, 2015
Messages
23
Reaction score
3
First Language
Polski [Polish]
This is strange. My buttons disappears when I'm opening menu and closing it
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,186
Reaction score
1,144
First Language
English
Primarily Uses
N/A

luiscesjr

Veteran
Veteran
Joined
Jun 26, 2014
Messages
117
Reaction score
11
First Language
Portuguese
Galv, is there a way to use this with your diagonal movement plugin? 

Code:
addButton(0,'map','Btnx',x,y,['button','up''right']);


Obviously this would not work, but is it possible


any other way?
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,186
Reaction score
1,144
First Language
English
Primarily Uses
N/A
I didn't think about diagonals.


You can stack buttons and pressing them would press all buttons in the stack, however I am unsure if this would work in this case I have not tested.
 

luiscesjr

Veteran
Veteran
Joined
Jun 26, 2014
Messages
117
Reaction score
11
First Language
Portuguese
Oh that did work! Amazing... I didn't think about this, now to make the diagonal buttons... =D


Screen.png
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,186
Reaction score
1,144
First Language
English
Primarily Uses
N/A
Updated to version 1.3 - fixed a bug when mouse movement wasn't disabled via the plugin and there was no button with index 0
 

Lithalean

Veteran
Veteran
Joined
May 27, 2016
Messages
39
Reaction score
35
First Language
English
Primarily Uses
Hello Galv,

I'm using a number of your plug-ins, in my iOS game.

When attempting to use this in place of a somewhat complex scheme using Yanflys picture common events, I run into an issue.

I should also mention I'm using Quasi Movement, and the common events are

Set Movement Route : Player (Skip)
Qmove (8,1,32)

That's up, and when using yanflys PCE if I hold the button down, the character will continually move. If I use your plug in, the character will move one step, then I'll need to hit the button again.

Thanks for any help, and all the work you have done for the community thus far!
 
Last edited:

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,186
Reaction score
1,144
First Language
English
Primarily Uses
N/A
You're using common event on button press? I believe I set the button up to trigger common event, not to be able to hold down to continuously run common event.


Have you tried using the script's emulation of button press?
 

Lithalean

Veteran
Veteran
Joined
May 27, 2016
Messages
39
Reaction score
35
First Language
English
Primarily Uses
@Galv 
Yes I'm using common events on button presses. You do have it set up so it will trigger common event and not continuously run it. I'm asking could you make a small modification / setting so it would continuously run it. I also can't use the scripts emulation of button presses because that defaults to MV's regular movement, and my game uses Quasi's pixel based movement.
Basically, I like the flexibility of this:
Screenshot at Jan 25 11-10-24.png
And want to combine it to make some type of hybrid with this.
Screenshot at Jan 25 11-11-28.png
Screenshot at Jan 25 11-06-00.png
Also in the video, in order to get the buttons to change color like that, I was using a tint/untint picture (every sec). So even though it blinks, it was a continual hold. This is more taxing on engine than a simple change of picture you have implemented in your plugin.
 
 
Last edited by a moderator:

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,186
Reaction score
1,144
First Language
English
Primarily Uses
N/A
No, I asked:

Have you tried using the script's emulation of button press?


Because it doesn't use MV's regular movement, it emulates actually pressing the arrow keys. It works with tests I have done in Quasi's pixel movement.
 

ha1lyeah

Villager
Member
Joined
Jul 4, 2014
Messages
5
Reaction score
0
Primarily Uses
Hi,
how to add an image to toggle this plugin on and off? So during the game, the player can select to use the buttons on the screen or the default touch option.
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,186
Reaction score
1,144
First Language
English
Primarily Uses
N/A
You would just add or remove the buttons with the basic script calls given in the plugin instructions. You could make a button that calls a common event that turns them on or off.
 

mpurnell

Veteran
Veteran
Joined
Dec 6, 2015
Messages
82
Reaction score
10
First Language
english
Primarily Uses
-- Deleted original post as fixed(personal error) --
 
Last edited:

peq42_

Yeet
Veteran
Joined
Feb 5, 2016
Messages
480
Reaction score
285
First Language
Portuguese(BR)
Primarily Uses
RMMV
No matter what I do, it doesn't work on MV 1.5.2 .

I used the demo as example to try make this button to work, but it simply doesn't. And there's no reason why.

Code:
Galv.SBTNS.addButton(7,'map','Btnclose',340,180,['script','$gameSwitches.setValue(30,true)'],255);
Galv.SBTNS.addButton(7,'map','Btnclose',180,340,['script','$gameSwitches.setValue(31,true)'],255);
I've put it inside a event exactly equal the one in your demo, but it doesn't work. I tried making it parallel, no success(It only draw the button when on parallel process, but still not work). Even if I copy everything to my game directly from demo it doesn't work.
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,186
Reaction score
1,144
First Language
English
Primarily Uses
N/A
There's always a reason why.

You need a unique id for each button. Both of your buttons have the same (7).
Make sure the button graphic actually exists, in the case of your script calls, /img/system/Btnclose.png.
Make sure that you have added your buttons to the precache setting.
 

peq42_

Yeet
Veteran
Joined
Feb 5, 2016
Messages
480
Reaction score
285
First Language
Portuguese(BR)
Primarily Uses
RMMV
There's always a reason why.

You need a unique id for each button. Both of your buttons have the same (7).
Make sure the button graphic actually exists, in the case of your script calls, /img/system/Btnclose.png.
Make sure that you have added your buttons to the precache setting.
I tried with different IDs too(That one I posted was my 4th attempt or something to make it work, I copy-pasted the code directly from another event but forgot to change. Even changing it didn't make things work), triple checked image names and added it.

Also, as i said, even a direct copy of your demo settings, objects and images,etc into my project didn't work. The best I managed to do was making the button appear, but it wouldn't do anything.
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,186
Reaction score
1,144
First Language
English
Primarily Uses
N/A
Here's a list of other suggestions to try:
https://galvs-scripts.com/errors-using-plugins/

Also, try creating a button and seeing if you can understand how it works instead of copy+pasting. You may be missing something or not changing something that needs to be changed for your project.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I'm back to the bugs.
100 bugs in my coding,
take one down,
fix it up,
132 bugs in my coding.
On the plus side, if all this rioting sparks another Covid outbreak... I will have a whole lot of time to work on my game. Not exactly how I wanted to get that time, but hey I'm a glass is half full... of RM kind of guy. :LZSwink:
A video once in a while won't hurt.
Have a craving for a Nesquik milkshake. No idea why. Haven't had one since I was a kid. lol. I remember them kinda tasting nice, but also leaving a lot of nasty powder at the bottom of the cup.

Forum statistics

Threads
98,070
Messages
949,013
Members
129,341
Latest member
Shinkukae
Top