Save-Point
KToggleButtons XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: KToggleButtons XP (/thread-8589.html)



KToggleButtons XP - kyonides - 11-03-2022

KToggleButtons XP

by Kyonides


Introduction

Are you Boring bored of using the same old text buttons?
Now you can replace them with some good looking Toggle Buttons! Shocked

"Old Screenshots"

"New Screenshots"

Instructions

Define a New Style

STYLES[:style_name] = { :name => "Basica", :cursor => "cursor1",
  :cursor_off => "cursor2", :on => "toggle1", :off => "toggle2", :button => "toggle3" }

Change Current Toggle Button Style - Use any of the keys you enter in the STYLES Hash.
$game_system.toggle_button_style = :basic

How to Define a Toggle Button Manager
Code:
@manager = KToggle::Manager.new(FontSize, LineHeight, "Name", LabelsArray)
@manager.setup_buttons(X, Y, LabelWidth, LabelHeight)
@manager.setup_cursor(true) # Create an Active Cursor

How to Set a State - Repeat as many times as deemed necessary!
@manager.set_state(1, some_variable)
@manager.set_state(2, some_variable)

How to Get a State - Here 1 stands for the first position in the Array.
@manager.state?(1)

Since the demos include a TestScene script, you can take a Detective look at it to learn a bit more on how to create your custom scene script. Winking


Terms & Conditions

Free for non commercial games.
Contact me if you needed for commercial games.
Mention me in your game credits.


RE: KToggleButtons - kyonides - 11-03-2022

Maintenance update

Not long ago I had to upload new versions of both demos to correct some visual glitches that I had found there. They weren't really important but you could find yourself being unable to read the nun's comments on the ACE version because I picked a terrible font color. Plus, I had to move up the buttons' texts a little bit in the XP version. I even updated the screenshot to reflect the changes.

As a bonus(?) I have also modified the start menu and uploaded a VX demo minutes ago.

Anyway, these new demos will be the only ones I will be supporting from now on. Feel free to redownload them at any time. Winking


RE: KToggleButtons - kyonides - 11-10-2022

Interesting Update

My script has now reached the 1.0.0 milestone!

The full version brings you the possibility to setup two different kinds of toggle buttons: the multiple choices set (by default) and the single choice set (by adding a single line of code).

It also allows you to easily setup what I called subheadings to identify your button sets.

[Image: ktogglebuttonsxp02.jpg]



RE: KToggleButtons - Kain Nobel - 11-11-2022

I figured I'd drop in and contribute some graphics (and ideas) for this cool script!  Ruby

You can crop these images and save them as individual icons (XP) or copy/paste them individually into your local icon sheets (VX and beyond).

These icons are from my personal collection; just stick to the original terms and conditions of kyonide's script and all is good in the world.

Also, I like credit too if the icons are used. Otherwise, I'll pop out of the bowl of rice with a poisoned blow dart and nobody will be the wiser... Winking 

Radio Buttons

[Image: GUI-Radio-Button.png]

Radio buttons represent your standard binary True / False settings. 

Check Buttons

[Image: GUI-Check-Button.png]

Check Buttons can be used to represent standard True / False, as well as Nil and Maybe.

I don't know how well these ambiguous Maybe and Nil states are represented in kyonide's current script, but feel free to use them as you wish.

Also, I tried to design these to be high contrast so they can still be visible even on a menu surface of any matching color (results may vary.)

More Context (Use Cases of Maybe and Nil)

I think as software users we take for granted the humble checkboxes and radio buttons but they really can be quite expressive (and super easy to use.) Definitely a great tool for menu designers, thank you for publishing. Congrats on the 1.0.0 milesetone!


RE: KToggleButtons - kyonides - 11-12-2022

(11-11-2022, 01:38 PM)Kain Nobel Wrote: Check Buttons

[Image: GUI-Check-Button.png]

Check Buttons can be used to represent standard True / False, as well as Nil and Maybe.

I don't know how well these ambiguous Maybe and Nil states are represented in kyonide's current script, but feel free to use them as you wish.
...
Nil : Nothing has been selected. (Sometimes represented as a False or a Maybe.)
True : The box has been checked as a "Yes" state.
False : The box has been checked as a "No" state. (Sometimes represented as a Nil.)
Maybe : The box has not been physically checked and represents an unchanged state. (Sometimes represented as a Nil.)
...
Here is how I use Maybe and Nil values in the context of my Missions system.

Well, you could call the nil or maybe buttons tri-state buttons. I know they do exist for even PC Linux distros with KDE GUI sometimes have them. Yet, I didn't want to include them in my scripts for a simple reason: most people don't need them under normal circumstances. Laughing

Besides, my "radio buttons" are meant for use in menus, not missions and the like. Happy with a sweat


RE: KToggleButtons - Kain Nobel - 11-12-2022

Less is more, I agree. With you always looking for ideas, I figured I'd give ya one and contribute some free icons that could be useful with this system.

Either way, these are great menu design elements. Take care and happy scripting!


RE: KToggleButtons - kyonides - 12-07-2023

Maintenance Update!

All RGSS-based versions have been upgraded recently! Grinning

To be honest with you, this version doesn't include any eye-catching feature at all. Happy with a sweat

It just allows you to call a couple of new methods for the KToggle::Manager and the KToggle::Cursor classes.
One of them is the new @manager.reset_cursor call, and yes, you can also manually set a specific position for the cursor to start at while launching or at any other moment.

I felt like it was a must to change the @manager.set_state method by adding an additional parameter so it should be called now just like this:

Code:
@manager.set_state(1, your_variable_here)
@manager.set_state(2, your_variable_here)

As you could see above, it begins with position 1 for convenience sake. Winking
This also lets you alter that value via a script call at any given time. Two Thumbs Up!