Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Windowskin Stretch/Tile as options.

Just prior to the recent HACK, someone requested information on how to disable the windowskin from stretching across the bitmap. It was an option in the earlier RM2K and 2K3 systems that allowed the designer to either stretch the skin or TILE the skin.

SephirothSpawn answered this request by merely pointing out that all he had to do was go into Window_Base's initialize def, and adding: self.stretch = false[/FONT] to the bottom of the def.

Works fine... if you only want it to TILE the skin and not to STRETCH it. But here's my quandry.

I want it to be optional.

I tried using code to turn the stretch feature on and off. I can turn the system from a 'stretched' skin into a 'tiled' skin system... but I cannot reverse the system without it freezing instead.

Code:
    [COLOR=Blue]self[/COLOR].z = [COLOR=Red]100[/COLOR]
    [COLOR=Green]# My Edit[/COLOR]
   [COLOR=Blue] if [/COLOR]$window_tile
      [COLOR=Blue]self[/COLOR].stretch [COLOR=Blue]= false[/COLOR]
    else
      [COLOR=Blue]self[/COLOR].stretch [COLOR=Blue]= true[/COLOR]  
    [COLOR=Blue]end
  end[/COLOR]
I've tried variants on the same theme, too. But they all have the same effect. If I try turning it off... it just freezes.

Any clues?
 
...

Your modification in Window_Base is completely fine.

The problem is the Script Event command. It evaluates the script you put it and returns the result.

Code:
    # Evaluation
    result = eval(script)
    # If return value is false
    if result == false
      # End
      return false
    end
    # Continue
    return true

This causes your game to freeze. BTW, there lines

Code:
    # If return value is false
    if result == false
      # End
      return false
    end
    # Continue
    return true

Could just have been
Code:
    # Return Result
    return result

But that's EB for ya. ;)


Anyways, like I said. In your Script command, just place return true at the bottom.

So like if you were turning switch 1 off,
Code:
$game_switches[1] == false
return true
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top