11-03-2022, 03:13 AM
KToggleButtons XP
by Kyonides
Introduction
Are you

Now you can replace them with some good looking Toggle Buttons!

Old Screenshots
![[Image: ktogglebuttonsxp01.jpg]](https://i.postimg.cc/qRD3QSKq/ktogglebuttonsxp01.jpg)
![[Image: ktogglebuttonsvx01.jpg]](https://i.postimg.cc/X74rdnmL/ktogglebuttonsvx01.jpg)
![[Image: ktogglebuttonsace01.png]](https://i.postimg.cc/t4fn0gjp/ktogglebuttonsace01.png)
New Screenshots
![[Image: ktogglebuttonsxp02.jpg]](https://i.postimg.cc/nhcPQt0Q/ktogglebuttonsxp02.jpg)
![[Image: ktogglebuttonsvx02.jpg]](https://i.postimg.cc/jdh15jQb/ktogglebuttonsvx02.jpg)
![[Image: ktogglebuttonsace02.jpg]](https://i.postimg.cc/fTsFDddC/ktogglebuttonsace02.jpg)
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


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