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.

DBS battler position

Im wondering how does the DBS to show the battler under the text of a window, and also, without being in the windows contents(see that it exapands out).

I dont get how can that be possible.
 
The battlers (both enemy & actor) are part of the sprite set (Spriteset_Battle). Actor sprites are drawn in viewport2.
The status window is a completely different object (Window_BattleStatus) that is drawn in viewport3 (above the battlers)

Look in Scene_Battle on lines 40 , 43.
 
Brewmeister":2qd7168u said:
The battlers (both enemy & actor) are part of the sprite set (Spriteset_Battle). Actor sprites are drawn in viewport2.
The status window is a completely different object (Window_BattleStatus) that is drawn in viewport3 (above the battlers)

Look in Scene_Battle on lines 40 , 43.

Ok. But my problem is the same:
11aad.png


The letters in self.contents are a bitmap. Bitmaps dont have z axis. The window class is composed by different sprites, but their z axis is global...

Then how is posible tihs:

1-The window back
2-The battlers
3-The letters(drawed in self.contents)

I dont know much about viewports. But it say 'Used when displaying sprites in one portion of the screen, with no overflow into other regions'.

Ok. But the contents of the window and the back are fixed and have the same z, with one or another viewport, no? That dont changue.

I still dont understand how is created that effect.
 
Ok, now I'm confused too. I thought the viewports actually stacked one above the other, and z values applied within the viewport.

Looks like the z of the window is 100, the window contents are 102, and the battlers in viewport 2 are all 101. (between the window & the contents).

I guess the question is: where do you want the battlers? behind the window?
 
Brewmeister":1z1kd2uz said:
Ok, now I'm confused too. I thought the viewports actually stacked one above the other, and z values applied within the viewport.

Looks like the z of the window is 100, the window contents are 102, and the battlers in viewport 2 are all 101. (between the window & the contents).

I guess the question is: where do you want the battlers? behind the window?
No. I want to know how to create that effect. Hoy i can set the z of window and window contents independently.

Maybe window contents z is window.z+1 always?
 
window.z + 2

Look in the help doc: RGSS Reference --> Game Library --> RGSS Built-in Classes --> Window --> z

"The Z-coordinate of the window's contents equals the window background's Z-coordinate plus 2."

so you can set the z of your sprite (or the viewport that contains the sprite) to be window.z + 1, and it will be between the window back & the contents

I'll be dipped in shit, and rolled in oats!!! I learned something! :scruff:
 
Brewmeister":vnnhexmi said:
window.z + 2

Look in the help doc: RGSS Reference --> Game Library --> RGSS Built-in Classes --> Window --> z

"The Z-coordinate of the window's contents equals the window background's Z-coordinate plus 2."

so you can set the z of your sprite (or the viewport that contains the sprite) to be window.z + 1, and it will be between the window back & the contents

I'll be dipped in shit, and rolled in oats!!! I learned something! :scruff:

Ok, thanks. It seemed too strange for me because it was broking all the rules of sprites and windows i had in mind.

Maybe is time to read again all the Xp doc.
 

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