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.

[Resolved] Viewport Questions.

Status
Not open for further replies.
I'm at work right now, so I don't have the ability to look this up for myself in rmxp, so, I'll ask here.

In Spriteset_Map, three viewports are defined by default. The map takes up viewport 1, Show Picture uses viewport 2, I'm guessing message windows take up viewport 3 (correct me if i'm wrong). Also, The viewport.z is set for viewports 2 and 3, with 3 being 5000. I know that the higher the number, the closer to the player it is, thus viewport 1 is behind 2 which is behind 3.

  1. What I want to know is, without changing the default values for the three viewports, can I create a viewport 4 above viewport 3 and a vieport 5 between viewports 2 and 3?
  2. And also, is there a maximum number you can assign a viewport.z?
  3. and can you assign a negative number to a viewport.z?
  4. Also, is there anything else, by default, that use viewports 1-3 on the map?
  5. Can you assign two viewports that are right next to eachother (since you can define their x and y) the same viewport.z?
  6. Is there also a way to cause a window, or picture, to switch viewports in game?
for example, I create a viewport4 with a viewport.z of 5001 (so that it is above viewport 3) and display a window in this viewport. While this window is active, it remains above everything else, but when it becomes deactive, it moves to viewport5 which has a viewport.z of 4999 (thus putting it behind viewport 3 but above viewport 2). When it becomes active again, it moves back to viewport4 and etc, etc...
Would that be possible? a script (which is in my head and in the planning stages) for my game is dependent upon this, If it can't be done, i need to think of another way to do what I need to do.​

Now, I've seen there are 4 viewports defined in Spriteset_Battler.
I'm guessing these are taken up by (in order from viewport 1-4)
  1. the background,
  2. the status and menu windows,
  3. the battlers,
  4. and the animations.
(Again, correct me if I'm wrong). Most of my other questions regarding this screen have already been asked.

Thank you.
 
The message window don't use a viewport to be displayed.
  1. Just make something like this:
    Code:
        @viewport4 = Viewport.new(0, 0, 640, 480)
        @viewport5 = Viewport.new(0, 0, 640, 480)
        @viewport4.z = 6000
        @viewport5.z = 600
  2. I don't know, but I think it is 9999
  3. I don't know, but why a negative z?
  4. The characters, the screen colors, the shake thing.
  5. Yes, I think.
  6. I don't know, but it should be like this:
    Code:
    window.viewport = Viewport.new(0, 0, 640, 480)
    window.viewport = my_other_viewport

About Spriteset_Battle viewports:
  1. Background, Enemies, Weather
  2. Actors
  3. Pictures
  4. Screen Color
 
1. So that is a yes then.
2. That's sort of what i thought, just wanted to make sure.
3. So that i can have something appear behind the map but not a panarama
4. and which viewports do they use?
5. ok, I'll have to test that then.
6. I'll have to test that too.

And a new question:

7. If viewport4 is (0, 0, 640, 480) and viewport5 is (0, 0, 600, 400) will viewport5 cut off the right and bottom edges of viewport4?
 
Status
Not open for further replies.

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