Godmaster Posted January 21, 2010 Report Share Posted January 21, 2010 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 More sharing options...
FanGameRevolver Posted January 21, 2010 Report Share Posted January 21, 2010 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 More sharing options...
Godmaster Posted January 25, 2010 Author Report Share Posted January 25, 2010 damn, this didn't work... I got a black screen on gm ¬¬ ... Link to comment Share on other sites More sharing options...
LarkSS Posted January 26, 2010 Report Share Posted January 26, 2010 If you're handling your level in a 3D environment to handle the zooming, couldn't you just always position the HUD to a certain Z distance from the camera? Link to comment Share on other sites More sharing options...
Recommended Posts