U
User
Guest
I use/read
http://docs2.yoyogames.com/index.ht... and display/cameras/camera_set_view_pos.html
------
I have a room 2560x1440.
And i want to see the center of my room in my game window 1024x768.
I can do it using room properties.
Let find the center. (2560-1024)/2=768, (1440-768)/2=336.
So camera properties will be X Pos=768, Y Pos=336, Width=1024, Height=768.
Viewport properties will be X Pos=0, Y Pos=0, Width=1024, Height=768.
Run-compile. Everything looks good.
But i need to do it from my code.
What i do
I create camera id=0. X Pos=768, Y Pos=336, Width=1024, Height=768. No angle, object etc.
And i see whole my room.
But i also need a viewport creation code and viewport setings code. And i can not find it in manual.
We can camera_create or camera_create_view with camera properties only.
And what about viewport_create?
How i can create camera and view from code?
http://docs2.yoyogames.com/index.ht... and display/cameras/camera_set_view_pos.html
------
I have a room 2560x1440.
And i want to see the center of my room in my game window 1024x768.
I can do it using room properties.
Let find the center. (2560-1024)/2=768, (1440-768)/2=336.
So camera properties will be X Pos=768, Y Pos=336, Width=1024, Height=768.
Viewport properties will be X Pos=0, Y Pos=0, Width=1024, Height=768.
Run-compile. Everything looks good.
But i need to do it from my code.
What i do
I create camera id=0. X Pos=768, Y Pos=336, Width=1024, Height=768. No angle, object etc.
Code:
view_camera[0] = camera_create_view(768, 336, 1024, 768, 0, 0, 0, 0, 0, 0);
camera_set_default(0);
But i also need a viewport creation code and viewport setings code. And i can not find it in manual.
We can camera_create or camera_create_view with camera properties only.
And what about viewport_create?
How i can create camera and view from code?