Posts: 4,607
Threads: 543
Joined: Dec 2009
Good News, Ye Merry Men and Women!
Bumping my thread just to let you know that all officially supported platforms now sport the latest builds of the HiddenChest engine!
Thank God, for the Windows build was driving me crazy for not openly telling me what prevented me from running as usual. Gladly I didn't spend as much time as I needed back with the previous builds (1.48 and 1.49 if I remember clearly). I have already playtested it and I can watch how my lovely OpenGL based vignette covers the map, with a special sepia tone applied onto it, I am using as a backdrop.
Everything I have posted before applies to the Windows build as well.
Happy Game Breaking!
"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
01-21-2020, 08:39 AM
(This post was last modified: 01-24-2020, 11:11 AM by kyonides.
Edit Reason: Edits :P
)
Redefining Some of the Recently Added Features
In the latest edition of your favorite game engine's private? gazette, you will learn that I had to change the way a few things worked lately.
*Ubuntu 18.04 - version 1.1.53 - Ruby 2.6
Fedora 31 - version 1.1.53 - Ruby 2.7!
Windows - version 1.1.52 - Ruby 2.6
Yes, Fedora's builds now sport Ruby 2.7! It took some time to adapt it, I had to struggle a little bit against the future... packages for the upcoming Fedora 32 release and make then run NOW. But just as you might have heard around already, the future is today! Or something the like.
They all include more colored backdrops for vignettes but I had to drop custom colors for vignettes because of compatibility issues across platforms, meaning you can't type your favorite RGBA Color combo but just type a symbol representing a specific color.
Backdrop.vignette_bitmap(color_or_array, boolean)
has become...
Backdrop.vignette_bitmap(symbol)
Where you can type something like nil for no color effect, :sepia, :gray, :black, :blue, :yellow, :red or even :green there!
Non Graphical Extensions
Point class (accepts integers as arguments) has been revamped and they also feature the Vector2 and Vector 4 floating point number, i.e. 1.512, vector classes! Even if people don't know what to do with them right now...
You can add, subtract, multiply and even divide Point, Vector2 or Vector4 objects! Just use an object of the same kind or any of the other classes mentioned here. Point will remain a binary container of integer values, while the Vector classes always convert values to floating point numbers.
Point members: x and y
Vector2 members: x and y
Vector4 members: x, y, z and w...
Don't ask me why Ancurio had picked w or any other name for the C++ structs...
I revealed those "hidden classes" because I thought you might eventually need it if you wanna draw lines or graphs or anything the like. Even if I dunno if I should ever include direct support for such features.
Plus Linux builds now also offer you the possibility to edit the config file to prevent them from loading system fonts when you preferred to stick to a single font + the default font face (FreeSans falsely called Arial on Windows - a strange behavior inherited from mkxp...)
"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
An Simple Bug That Just Hated to Read
Alice in Wonderland Has Been Fixed!
Why did I even mention Lewis Carroll's tale? Err, that's mainly because of its rabbit!
Or was it due to its mad hater!?
Oh no! Now I do recall why! I hadn't recently checked out if you could resize the window properly a la Alice that ended up growing and shrinking "at will"...
I had only tested my builds in order to confirm if the window could be downsized and later on get its former glory restored!
Whenever you tried to resize it by setting a larger width or height, you see it would crash!
But that's not the case anymore!
You're supposed to do it no matter what's the executable's default dimensions.
Happy Game Squeezing!
I mean...
Happy Game Window Resizing!
(If that ever makes sense...)
"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
03-08-2020, 09:30 AM
(This post was last modified: 03-13-2020, 09:26 AM by kyonides.
Edit Reason: Uploaded Windows Binaries
)
A Maintenance Version Has Been Released!
Beware! It might hit you like a thunderbolt!
In the current version you might no longer notice a strange weather bug that allowed you to show effects like rain and storm and snow but only in a reduced section of the game screen. Games with resolutions higher than 800 pixels (in any direction) were affected by this innocent oversight.
Thank Melana for the bug report!
By the way, you can bug her to get a preview version of the Windows build.
The latest update is available on:
Happy Stormy Days!
"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
A Small Update That is Not Causing Climate Change
I'm back on track only to let you guys know that I have uploaded the Windows binary executables that include the fix I mentioned in my previous post. So you're now free to download the RAR file at any given time. Isn't it good news?
"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
Toggling a Bump for Fun!
In version 1.1.56 of your favorite local engine, you are now able to make custom toggle buttons or radio buttons or the like.
By creating a custom sprite class object you can assign it its active and inactive states and the selected button and it will automatically pick either the active or inactive state bitmap. Of course, you still need to setup the button state yoursefl.
You got to admit it is a highly convenient feature for it lets you forget about creating several sprites and then group them in a set only to get a single button sprite work as expected.
Don't worry, guys! You can change the graphics at any time!
Just make sure the button is slightly smaller than the button backdrop sprite.
Sadly, there are only *Ubuntu binary executables available right now.
Here you can take a look at the test script I have been using while playing with HiddenChest.
Code: module ButtonData
TITLE = "Scene Settings"
BACKDROP = 'recycle texture'
ICONS = %w{toggle1 toggle2 toggle3}
LABELS = ['Find Treasures', 'Kick Asses', 'Play Minigames',
'Contract Covid-19', 'Hug Corona-chan']
end
class MenuScene
def main
@timer = 0
@bg = Sprite.new
@bg.bitmap = RPG::Cache.title(ButtonData::BACKDROP)
@title = Sprite.new
@title.set_xy(Graphics.width / 2 - 120, 8)
@title.bitmap = bit = Bitmap.new(240, 32)
bit.draw_text(0, 0, 240, 32, ButtonData::TITLE, 1)
@buttons = []
@labels = []
@states = [true, false, true, false, true]
total = ButtonData::LABELS.size
total.times do |n|
cy = 44 + n * 32
sprite = ToggleButtonSprite.new
sprite.set_xy(8, cy)
sprite.bitmap_on = RPG::Cache.icon(ButtonData::ICONS[0])
sprite.bitmap_off = RPG::Cache.icon(ButtonData::ICONS[1])
sprite.button = RPG::Cache.icon(ButtonData::ICONS[2])
sprite.state = @states[n]
@buttons << sprite
sprite = Sprite.new
sprite.set_xy(36, cy)
sprite.bitmap = bit = Bitmap.new(160, 28)
bit.draw_text(0, 0, bit.width, bit.height, ButtonData::LABELS[n])
@labels << sprite
end
Graphics.transition
main_loop while $scene == self
Graphics.freeze
(@buttons + @labels).each{|b| b.dispose }
@title.dispose
@bg.dispose
@states.clear
end
def main_loop
Graphics.update
Input.update
update
end
def update
return @timer -= 1 if @timer > 0
if Input.trigger?(Input::B)
Audio.play_cancel
$scene = Scene_Title.new
return
elsif Input.trigger?(Input::C)
Audio.play_ok
@buttons[0].state = !@buttons[0].state
elsif @buttons[0].mouse_above? and Input.left_click?
Audio.play_ok
@buttons[0].state = !@buttons[0].state
@timer = Graphics.frame_rate / 3
elsif Input.trigger?(Input::KeyP)
Audio.play_ok
Graphics.save_screenshot
end
end
end
Those Ubuntu or Kubuntu users or similar Linuxers break a leg!
Perhaps I should say break a finger instead!?
"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
05-07-2020, 05:40 AM
(This post was last modified: 05-07-2020, 11:55 PM by kyonides.
Edit Reason: Ruby 2.7
)
Now the hidden ToggleButtonSprite class allows you to use a bitmap to show the player what's on focus right now!
I hope this improvement makes it easy to notice where the hell you are at any given time.
By the way, it runs on Ruby 2.7!
In my previous post I forgot to mention I had also included the window padding option in my engine. You see, I had only talked about it on the What's up, RMers? thread
Here is the test script I have been using lately.
Code: module ButtonData
TITLE = "Scene Settings"
BACKDROP = 'recycle texture'
ICONS = %w{toggle1 toggle2 toggle3 toggle4}
LABELS = ['Find Treasures', 'Kick Asses', 'Play Minigames',
'Contract Covid-19', 'Hug Corona-chan', 'Escape']
end
class ToggleButtons
def initialize(pos, states)
@index = pos
@timer = 0
@buttons = []
@labels = []
@total = ButtonData::LABELS.size
@total.times do |n|
cy = 44 + n * 32
sprite = ToggleButtonSprite.new
sprite.set_xy(8, cy)
sprite.frame = RPG::Cache.icon(ButtonData::ICONS[0])
sprite.bitmap_on = RPG::Cache.icon(ButtonData::ICONS[1])
sprite.bitmap_off = RPG::Cache.icon(ButtonData::ICONS[2])
sprite.button = RPG::Cache.icon(ButtonData::ICONS[3])
sprite.state = states[n]
@buttons << sprite
sprite = Sprite.new
sprite.set_xy(36, cy)
sprite.bitmap = bit = Bitmap.new(160, 28)
bit.draw_text(0, 0, bit.width, bit.height, ButtonData::LABELS[n])
@labels << sprite
end
@buttons[0].focus = true
@buttons[5].block = true
end
def change_focus(pos)
@buttons[@index].focus = false
@buttons[pos].focus = true
@index = pos
end
def update
@buttons.each{|button| button.update }
return @timer -= 1 if @timer > 0
if Input.left_click?
pos = 0
@buttons.each do |button|
unless button.mouse_above?
pos += 1
next
end
if button.block
Audio.play_buzzer
change_focus(pos)
return @timer = Graphics.frame_rate / 3
end
Audio.play_ok
change_focus(pos) if @index != pos
button.state = !button.state
@timer = Graphics.frame_rate / 3
return
end
return
elsif Input.trigger?(Input::UP)
Audio.play_cursor
@buttons[@index].focus = false
@index = (@index - 1) % @total
@buttons[@index].focus = true
return
elsif Input.trigger?(Input::DOWN)
Audio.play_cursor
@buttons[@index].focus = false
@index = (@index + 1) % @total
@buttons[@index].focus = true
end
end
def dispose
(@buttons + @labels).each{|b| b.dispose }
end
def states() @buttons.map(&:state) end
end
class MenuScene
def main
@bg = Sprite.new
@bg.bitmap = RPG::Cache.title(ButtonData::BACKDROP)
@title = Sprite.new
@title.set_xy(Graphics.width / 2 - 120, 8)
@title.bitmap = bit = Bitmap.new(240, 32)
bit.draw_text(0, 0, 240, 32, ButtonData::TITLE, 1)
states = [true, false, true, false, true, false]
@buttonset = ToggleButtons.new(0, states)
states.clear
Graphics.transition
main_loop while $scene == self
Graphics.freeze
@buttonset.dispose
@title.dispose
@bg.dispose
end
def main_loop
Graphics.update
Input.update
update
end
def update
@buttonset.update
if Input.trigger?(Input::B)
Audio.play_cancel
@buttonset.states
$scene = Scene_Title.new
return
elsif Input.trigger?(Input::KeyP)
Audio.play_ok
Graphics.save_screenshot
return
end
end
end
My Final Message is...
There is no end!
Unless catches you off guard.
"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
05-08-2020, 09:23 AM
(This post was last modified: 05-08-2020, 09:23 AM by kyonides.)
A Revamped ToggleButtonSprite Class
and its mysterious Have Arrived!
I know, what the hell am I talking about here?
Fear not, my friends! Everything is fine with my HiddenChest Engine - Linux Edition. It just happens that I created a Spy module that will serve as an exclusive observer or listener kind of structure there. Starting from version 1.1.57 you will be able to create such a menu full of toggleable buttons with less lines of code!
I almost forgot you need some badly needed proof to confirm my previous statement. Do not worry, guys! I have prepared some new version of my test code as well. Just take a look at it.
Note: Simple tests also seemed to confirm that the mouse support has been improved as well.
Code: module ButtonData
TITLE = "Scene Settings"
BACKDROP = 'recycle texture'
ICONS = %w{toggle1 toggle2 toggle3 toggle4}
LABELS = ['Find Treasures', 'Kick Asses', 'Play Minigames',
'Contract Covid-19', 'Hug Corona-chan', 'Escape']
end
class ToggleButtons
def initialize(pos, states)
@index = pos
@timer = 0
@buttons = []
@labels = []
ToggleButtonSprite.timer = Graphics.frame_rate / 3
@total = ButtonData::LABELS.size
@total.times do |n|
cy = 44 + n * 32
sprite = ToggleButtonSprite.new
sprite.set_xy(8, cy)
sprite.frame = RPG::Cache.icon(ButtonData::ICONS[0])
sprite.bitmap_on = RPG::Cache.icon(ButtonData::ICONS[1])
sprite.bitmap_off = RPG::Cache.icon(ButtonData::ICONS[2])
sprite.button = RPG::Cache.icon(ButtonData::ICONS[3])
sprite.state = states[n]
@buttons << sprite
sprite = Sprite.new
sprite.set_xy(36, cy)
sprite.bitmap = bit = Bitmap.new(160, 28)
bit.draw_text(0, 0, bit.width, 28, ButtonData::LABELS[n])
@labels << sprite
end
Spy.button = @buttons[0]
@buttons[5].block = true
end
def update
@buttons.each{|button| button.update }
if Input.trigger?(Input::UP)
Audio.play_cursor
@index = (@index - 1) % @total
Spy.button = @buttons[@index]
return
elsif Input.trigger?(Input::DOWN)
Audio.play_cursor
@index = (@index + 1) % @total
Spy.button = @buttons[@index]
end
end
def dispose
(@buttons + @labels).each{|b| b.dispose }
Spy.clear_button # or Spy.button = nil to clear the Spy's button
end
def states() @buttons.map(&:state) end
end
class MenuScene
def main
@bg = Sprite.new
@bg.bitmap = RPG::Cache.title(ButtonData::BACKDROP)
@title = Sprite.new
@title.set_xy(Graphics.width / 2 - 120, 8)
@title.bitmap = bit = Bitmap.new(240, 32)
bit.draw_text(0, 0, 240, 32, ButtonData::TITLE, 1)
states = [true, false, true, false, true, false]
@buttonset = ToggleButtons.new(0, states)
states.clear
Graphics.transition
main_loop while $scene == self
Graphics.freeze
@buttonset.dispose
@title.dispose
@bg.dispose
end
def main_loop
Graphics.update
Input.update
update
end
def update
@buttonset.update
if Input.trigger?(Input::B)
Audio.play_cancel
@buttonset.states
$scene = Scene_Title.new
return
elsif Input.trigger?(Input::KeyP)
Audio.play_ok
Graphics.save_screenshot
return
end
end
end
Doesn't it look clean and easy to understand now?
It seems my laziness caught me off guard once again.
I have no other choice but to keep you waiting for a Windows binary executable till...
err, what about next year? It sounds like a terrific idea, don't you think, pals?
"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
05-09-2020, 09:31 AM
(This post was last modified: 05-10-2020, 02:07 AM by kyonides.)
The Was Dismissed Officially!
Well, you got to agree that it was not a good name for such a module. It is now known as the ToggleGroup class!
Why did I change its name and structure!?
You see, I wanted to let you manage several groups of buttons you could toggle at any time so disposable classes were a good choice. A module is a single Module class instance so you could not make several copies of it. Classes can be multiplied as many times as you ever need to.
Visually there is no change at all except that the interface now works smoothly. The buttons and the menu containing the group will always know where did you click last time. Even if you suddenly start using the keyboard or the gamepad, it will update the focus just as expected.
You got to admit that your menus will surely look a lot better than before.
Or do you plan to keep using those ugly menus where you need to use the window's default squarish cursor that everybody hates?
You don't believe me!? Then go ask Steam users and they will tell you how much they dislike games with some default RTP interface.
Here is the latest version of my Toggle Button "Test" Menu.
Code: # * Toggle Button Menu for HiddenChest
# Scripter : Kyonides Arkanthes
# 2020-05-09
module ButtonData
TITLE = "Scene Settings"
BACKDROP = 'recycle texture'
ICONS = %w{toggle1 toggle2 toggle3 toggle4}
LABELS = ['Find Treasures', 'Kick Asses', 'Play Minigames',
'Contract Covid-19', 'Hug Corona-chan', 'Escape']
end
class ToggleButtons
def initialize(states)
Settings.click_timer = 10 #Graphics.frame_rate / 3
@manager = ToggleGroup.new
@timer = 0
@buttons = []
@labels = []
@total = ButtonData::LABELS.size
@total.times do |n|
cy = 44 + n * 32
sprite = ToggleButton.new
sprite.manager = @manager
sprite.set_xy(8, cy)
sprite.frame = RPG::Cache.icon(ButtonData::ICONS[0])
sprite.bitmap_on = RPG::Cache.icon(ButtonData::ICONS[1])
sprite.bitmap_off = RPG::Cache.icon(ButtonData::ICONS[2])
sprite.button = RPG::Cache.icon(ButtonData::ICONS[3])
sprite.state = states[n]
@buttons << sprite
sprite = Sprite.new
sprite.set_xy(36, cy)
sprite.bitmap = bit = Bitmap.new(160, 28)
bit.draw_text(0, 0, bit.width, 28, ButtonData::LABELS[n])
@labels << sprite
end
@manager.buttons = @buttons
@buttons[5].block = true
end
def update
@buttons.each{|button| button.update }
if Input.trigger?(Input::UP)
Audio.play_cursor
@manager.index = (@manager.index - 1) % @total
return
elsif Input.trigger?(Input::DOWN)
Audio.play_cursor
@manager.index = (@manager.index + 1) % @total
end
end
def dispose
@labels.each{|b| b.dispose }
@labels.clear
@manager.dispose
end
def states() @buttons.map(&:state) end
end
class MenuScene
def main
@bg = Sprite.new
@bg.bitmap = RPG::Cache.title(ButtonData::BACKDROP)
@title = Sprite.new
@title.set_xy(Graphics.width / 2 - 120, 8)
@title.bitmap = bit = Bitmap.new(240, 32)
bit.draw_text(0, 0, 240, 32, ButtonData::TITLE, 1)
states = [true, false, true, false, true, false]
@buttonset = ToggleButtons.new(states)
states.clear
Graphics.transition
main_loop while $scene == self
Graphics.freeze
@buttonset.dispose
@title.dispose
@bg.dispose
end
def main_loop
Graphics.update
Input.update
update
end
def update
@buttonset.update
if Input.trigger?(Input::B)
Audio.play_cancel
@buttonset.states
$scene = Scene_Title.new
return
elsif Input.trigger?(Input::KeyP)
Audio.play_ok
Graphics.save_screenshot
return
end
end
end
Now I am lazy and prefer to fetch some
So I am leaving now!
By the way, Windows users, you are out of luck!
"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: 27
Threads: 7
Joined: May 2009
By the way, do you have repository for latest source?(Github wasn't updated for months...) Wonder if they can be compiled under Windows...
|