Check if instance is in the viewport

0 favourites
  • 2 posts
  • Using the scripting API, do we have access to the view port coordinates? I want to create a filter like the system condition is on screen for the instance. Is that possible with properties exposed now (did i miss it) or is that something that is coming in the future?

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • i was able to solve this by mixing both events and js

    the way i solved this was by having a function whose condition picked object by using is on screen in system. that function executed sciprtInEvents, where it would iterate the picked instances and and push them to my queue.

    var instances = runtime.objects.Moveable.getPickedInstances();
    for(let i of instances){
    	//queue up instances that appear on screen 
    	turnSystem.queue.enqueue(i);
    }
    

    then from my turn system class. i execute this function at the start of every turn cycle. you need to have a different mindset when trying to reason about events and java script together. but so far it's turned out to be really powerful.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)