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.

About window

How do one edit:
1 the window posistion
2 window size
3 transparency
4 how do one makes the little arrow at the bottom dissapera?
5 how do one close the window without having to press the confirm button?

As always, thanks in advance
 
a window is created by using Window_Base.new(x, y, width, height) which will cover question 1 and 2.

3. @window = Window_Base.new(x, y, width, height)
@window.opacity = 150 # 255 being full visible

4. Remove it from the windowskin

5. Depends on which window you're talking about. If you want to return to the map just use $scene = Scene_Map.new or you could dispose the window if it is on the map.

@window.dispose

Just ask if you didn't understand something or have any other questions.
 
To elaborate a little more:

1) All windows are either a) a specialized window object, or just a window created simply from the window base class (granted, all specialized windows are also created from the Window_Base class, but specialized have many of their own methods and settings that happen automatically).

Say you just wanted to make the default gold window appear on screen somewhere.
Code:
@your_window = Window_Gold.new
This is a specialized window class, as you do not need to define the x, y, width, height or any other attribute of this window. To see what these are by default, check within the class under def initialize.

Anyways, to edit the windows position, you would only need to:
Code:
@your_window.x = some_position
@your_window.y = some_position

If you need any more information on this, I would be happy to share.

------------------------------

2) This you really want to steer clear of until you have an understanding of windows. You can simply use:
Code:
@your_window.width = width
@your_window.height = height
But this CAN make your window not opperate correctly, make your windows contents (where everything is virtually drawn on, the window itself is just a constructed sprite) fade off the side of your window (see 3), or other problems in general

-----------------------

3)
Code:
@your_window.opacity = alpha
@your_window.back_opacity = alpha
@your_window.contents_opacity = alpha
Just find one you like.

4) The arrows appear there when your window's contents (again, the clear bitmap everything is drawn on) is more than your windows width or height - 32 or whenever part of your contents if off your window (due to alterations of the ox and oy instances).

Either make your contents the right size, or fix your windowskin to not have the arrows.

----------

5) Like Raz said, depends on what you are doing.



I strongly suggest you seek out and find Dubalex's tutorials. They cover an introduction of windows, creating your own, then working with them in a scene. Or Mr. Mo's tutorials. Both links can be found in one of those links in my signature.
 
You must create a "contents" bitmap, like this:
Code:
@your_window.contents = Bitmap.new(@your_window.width - 32, @your_window.height - 32)
Then use the Bitmap's method "draw_text":
Code:
@your_window.draw_text(0, 0, @your_window.width, @your_windowheight, 'My text !!!')

Hope it helps you :)
 

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