Save-Point
KToggleButtons VX + ACE - 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 VX/VXAce (RGSS2/3) Engines (https://www.save-point.org/forum-117.html)
+---- Thread: KToggleButtons VX + ACE (/thread-10788.html)



KToggleButtons VX + ACE - kyonides - 10-28-2024

KToggleButtons VX + ACE

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
VX Way
STYLES[:style_name] = { :name => "Basica", :cursor => "cursor1",
  :cursor_off => "cursor2", :on => "toggle1", :off => "toggle2", :button => "toggle3" }

ACE Way
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.
$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.