Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Zooming the view, keeping the hud fixed, how?


Godmaster

Recommended Posts

Hello guys,

Currently I'm trying to make a zooming view with rotating events in 2d, like Sonic Nebulous from Ironrind, but I can't keep the hud in fixed size, that uses to shrink/grow with the zooming view.

How I can solve this? I searched for this in gm forums but every working script were just made to various instances in a same room (like Super Smash Bros), and most of them don't work properly.

Please!

Link to comment
Share on other sites

Hello guys,

Currently I'm trying to make a zooming view with rotating events in 2d, like Sonic Nebulous from Ironrind, but I can't keep the hud in fixed size, that uses to shrink/grow with the zooming view.

If your using GAME MAKER 7pro or 8pro I may be able to help.

I suppose Ironwind could explain this better, but what I would do is to use a 3D projection, rather then the default camera, then place an orthographic projection over the screen that contains the HUD.

So:

step 1: start d3d mode

step 2: create a 3D projection that moves in and out based on your characters speed.

step 3: Draw the orthographic projection.

Step 1 must be performed in a CREATION EVENT

d3d_start()
d3d_set_hidden(true)
d3d_set_culling(false)
d3d_set_perspective(true)[/CODE]

Step 2 must be performed in a DRAW EVENT (Replace 'player' with the object to follow and <distance to player> with the desired variable)

[CODE]d3d_set_projection(player.x, player.y+1, <distance to player>, player.x, player.y, 0, 0, -1, 0)[/CODE]

Step 3 also in a DRAW EVENT (replace the width/heigt bits with your games window size for best results)

[CODE]d3d_set_projection_ortho(0,0,<width of game window>, <height of game window>, 0)[/CODE]

then draw the sprites to apear in the HUD using functions such as:

draw_sprite_stretched_ext()

or for fonts:

draw_set_font()

draw_set_halign() (horizontal alignment)

draw_text()

knowing me I'm probably missing some important step. Also I have no idea how to get the camera to rotate...but I've seen the 3D camera's rotate before in games so I know its possible. Ironwind might be using a completly different method then the one I'm using...so he would be the person to ask about the camera rotation.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...