Posts: 4,607
Threads: 543
Joined: Dec 2009
11-03-2022, 03:13 AM
(This post was last modified: 10-28-2024, 10:55 PM by kyonides.)
KToggleButtons XP
by Kyonides
Introduction
Are you bored of using the same old text buttons?
Now you can replace them with some good looking Toggle Buttons!
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 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.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Posts: 4,607
Threads: 543
Joined: Dec 2009
11-03-2022, 11:25 PM
(This post was last modified: 11-04-2022, 01:21 AM by kyonides.
Edit Reason: VX Demo
)
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.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Posts: 4,607
Threads: 543
Joined: Dec 2009
11-10-2022, 02:27 AM
(This post was last modified: 12-07-2023, 07:49 AM by kyonides.)
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.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Posts: 937
Threads: 101
Joined: May 2009
11-11-2022, 01:38 PM
(This post was last modified: 11-11-2022, 02:02 PM by Kain Nobel.
Edit Reason: Fixed inaccurately displayed icons.
)
I figured I'd drop in and contribute some graphics (and ideas) for this cool script!
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...
Radio Buttons
Radio buttons represent your standard binary True / False settings.
Check Buttons
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.)
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!
Posts: 4,607
Threads: 543
Joined: Dec 2009
11-12-2022, 12:23 AM
(This post was last modified: 11-12-2022, 12:24 AM by kyonides.)
(11-11-2022, 01:38 PM)Kain Nobel Wrote: Check Buttons
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 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.
Besides, my "radio buttons" are meant for use in menus, not missions and the like.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Posts: 937
Threads: 101
Joined: May 2009
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!
Posts: 4,607
Threads: 543
Joined: Dec 2009
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.
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.
This also lets you alter that value via a script call at any given time.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
|