KToggleButtons ACE

KToggleButtons ACE

by Kyonides Arkanthes
​


Introduction

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

Version 1.1.1

ktogglebuttonsace02.jpg


It's also available for XP & VX!​

Instructions

Define a New Style

Ruby:
STYLES[:basic] = { 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.
Ruby:
$game_system.toggle_button_style = :basic

How to Define a Toggle Button Manager
Ruby:
@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!
Ruby:
@manager.set_state(index, some_variable)

How to Get a State - Here 1 stands for the first position in the Array.
Ruby:
@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. 😉


Terms & Conditions

Free for non commercial games.
Contact me if you needed for commercial games.
Mention me in your game credits.
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.

As a bonus(?) I have also modified the start menu.

Anyway, these new demos will be the only ones I will be supporting from now on. Feel free to redownload them at any time. 😉
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 (by default) and single choice (by adding a single line of code).

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

All RGSS-based versions
have been upgraded recently! 😀​

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

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:

Ruby:
@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. 😉
This also lets you alter that value via a script call at any given time.

Original thread: https://forums.rpgmakerweb.com/threads/ktogglebuttons-ace.152434/