HiddenChest RGSS Player Executable
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 Laughing 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. Grinning

Everything I have posted before applies to the Windows build as well.

Happy Game Breaking! Laughing
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }
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! Shocked 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! Laughing + Tongue sticking out Or something the like. Happy with a sweat

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. Confused

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! Grinning

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! Grinning Even if people don't know what to do with them right now... Laughing

You can add, subtract, multiply and even divide Point, Vector2 or Vector4 objects! Winking 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... Confused

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. Laughing + Tongue sticking out

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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }
An Simple Bug That Just Hated to Read
Alice in Wonderland Has Been Fixed!
Shocked

Why did I even mention Lewis Carroll's tale? Confused Err, that's mainly because of its rabbit! Shocked 

Or was it due to its mad hater!? Happy with a sweat 

Oh no! Shocked Now I do recall why! Grinning I hadn't recently checked out if you could resize the window properly a la Alice that ended up growing and shrinking "at will"... Laughing + Tongue sticking out

I had only tested my builds in order to confirm if the window could be downsized and later on get its former glory restored! Happy with a sweat

Whenever you tried to resize it by setting a larger width or height, you see Happy with a sweat it would crash! Confused 

But that's not the case anymore! Shocked

You're supposed to do it no matter what's the executable's default dimensions. Grinning

Happy Game Squeezing! Tongue sticking out
I mean... Happy with a sweat
Happy Game Window Resizing! Laughing

(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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }
A Maintenance Version Has Been Released!


Shocked 
Beware! It might hit you like a thunderbolt!
Laughing 

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. Happy with a sweat  Games with resolutions higher than 800 pixels (in any direction) were affected by this innocent oversight.

Thank Melana for the bug report! Laughing

By the way, you can bug her to get a preview version of the Windows build. Laughing + Tongue sticking out


The latest update is available on:
  • Fedora 31
  • Windows
Happy Stormy Days! Laughing
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }
A Small Update That is Not Causing Climate Change
Laughing + Tongue sticking out

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. Grinning Isn't it good news? Tongue sticking out
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }
Toggling a Bump for Fun!

[Image: hiddenchest10.jpg]

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. Laughing + Tongue sticking out

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. Laughing

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. Grinning

Don't worry, guys! Happy You can change the graphics at any time! Two Thumbs Up!
Just make sure the button is slightly smaller than the button backdrop sprite. Laughing

Sad Sadly, there are only *Ubuntu binary executables available right now. Laughing + Tongue sticking out 

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! Laughing 
Perhaps I should say break a finger instead!? Confused
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }
A Revisited ToggleButtonSprite Class Has Arrived! Shocked

[Image: hiddenchest11.jpg]
I'm sorry, you can't escape anymore! Confused

Now the hidden ToggleButtonSprite class allows you to use a bitmap to show the player what's on focus right now! Grinning 
I hope this improvement makes it easy to notice where the hell you are at any given time. Laughing

By the way, it runs on Ruby 2.7! Shocked

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... Confused 
There is no end! Laughing + Tongue sticking out

Unless Corona-Chan catches you off guard. Sad  
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }
A Revamped ToggleButtonSprite Class
and its mysterious Spy Have Arrived! Shocked

Laughing I know, what the hell am I talking about here?
Grinning 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! Shocked 

Oops! I almost forgot you need some badly needed proof to confirm my previous statement. Grinning 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. Happy
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? Winking

Nervous It seems my laziness caught me off guard once again. Confused


I have no other choice but to keep you waiting for a Windows binary executable till...
If I Recall Correctly err, what about next year? It sounds like a terrific idea, don't you think, pals? Laughing + Tongue sticking out
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }
The Spy Was Dismissed Officially! Shocked

Laughing Well, you got to agree that it was not a good name for such a module. It is now known as the ToggleGroup class! Grinning 
Happy with a sweat Why did I change its name and structure!?

If I Recall Correctly 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. Two Thumbs Up!
Visually there is no change at all Laughing + Tongue sticking out  except that the Mouse 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. Grinning

You got to admit that your menus will surely look a lot better than before. Laughing 
Really? Or do you plan to keep using those ugly menus where you need to use the window's default squarish cursor that everybody hates?
Huh? 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. Laughing + Tongue sticking out

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 Laughing and prefer to fetch some Beer
So I am leaving now! Laughing + Tongue sticking out 

By the way, Windows users, you are out of luck! Indifferent
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }
By the way, do you have repository for latest source?(Github wasn't updated for months...) Wonder if they can be compiled under Windows...
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Neko RMXP Player for Android JayRay 2 8,202 10-05-2014, 03:46 AM
Last Post: DerVVulfman
   ARGSS - Remaking RGSS/2 Player vgvgf 13 22,567 04-21-2010, 04:34 AM
Last Post: vgvgf



Users browsing this thread: 6 Guest(s)