• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

How to return the view number [0...7] that the camera is associated with?

FoxyOfJungle

Kazan Games
I for example can return the camera from the view using view_camera[0...7].

But how to return the view the camera is associated with? Something like camera_get_view()... I need to return something from 0 to 7.

This code needs to be executed outside the Draw Event.
Thanks for listening.
 
Last edited:

kburkhart84

Firehammer Games
I don't think there is a function for that(especially since a camera can be created and not actually be associated with a view). Instead, you would just have to have code that remembers what view you assigned a camera to when you do it. Since you yourself are doing it, you should be able to make a map or something to associate cameras with views if you need that.
 

FoxyOfJungle

Kazan Games
I don't think there is a function for that(especially since a camera can be created and not actually be associated with a view). Instead, you would just have to have code that remembers what view you assigned a camera to when you do it. Since you yourself are doing it, you should be able to make a map or something to associate cameras with views if you need that.
Good idea, I will try this. I technically associate the camera with the view when using view_set_camera(view, camera).

Thank you!
 

chamaeleon

Member
Since cameras can exist without a view, I don't think they have any information about what the view is. You assign a created camera to the view array, but just like assigning a number to an array, the number doesn't know which array element it is stored in.

Edit: Seems like a good suggestion @kburkhart84 and I have nothing better to add myself.
 
Top