Hello everyone,
I'm confused with the use of views and cameras.
I'm in the first room and I want to create another room (with view and camera) dynamically and then go to that room, so I used the code below :
Unfortunately it doesn't work : what is displayed on the newly created room seems to fit what is displayed when in the first room.
When I switch on and off the viewport 0 in the IDE of my first room, it appears the result changes in the room created dynamically
Any suggestion?
Thanks for your help
I'm confused with the use of views and cameras.
I'm in the first room and I want to create another room (with view and camera) dynamically and then go to that room, so I used the code below :
GML:
myRoom = room_add(); //Creates the room
room_set_width(myRoom, myRoomWidth); //Sets the room width
room_set_height(myRoom, myRoomHeight); //Sets the room height
room_set_persistent(myRoom, false); //Sets the persistance to false
room_set_view_enabled(myRoom, true); //Enables the use of views in the new room
room_set_viewport(myRoom, 0, true, 0, 0, myViewWidth, myViewHeight); //Creates and sets the viewport 0 that will be displayed on screen
view_camera[0] = camera_create_view(0, 0, myViewWidth, myViewHeight); //Creates a camera and sets the view that will be displayed on the viewport 0
//Placing the tiles and objects in the room here...
room_goto(myRoom); //Goes to the room
When I switch on and off the viewport 0 in the IDE of my first room, it appears the result changes in the room created dynamically
Any suggestion?
Thanks for your help