Anyone have Proximity rules?

TwistedMechTwistedMech Member Posts: 408
edited November -1 in Tech Support
is there a way to know if an actor is in the viewable window?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    If your scene is NOT scrollable, you simply need to check that the Actor's X is between 0 and 480, and that the Actor's Y is between 0 and 320.

    However, if your screen IS scrollable, you'll need to place another Actor in the Scene that keeps track of the Camera coordinates. You can place the actor just outside the visible area - the lower left works nicely. You'll need to create two global properties (real) called something like CameraX and CameraY.

    Once you drag an Actor into the Scene, it becomes an INSTANCE of the Actor. Instances have access to properties of the Scene (the Actor's Prototype does not).

    Double-click on an Actor in the Scene to access its properties.
    Click the padlock to edit the behaviors of the Instance.

    In the "Camera Tracker" instance, you'll need to Constrain the Camera's OriginX to the global CameraX. Do the same for the Camera's OriginY.

    Now that you have those coordinates tracked, you simply need to check that the Actor's X is between game.CameraX and game.CameraX + 480, and that the Actor's Y is between game.CameraY and game.CameraY + 320.

    Hope this helps!
    Joe
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    If your scene is NOT scrollable, you simply need to check that the Actor's X is between 0 and 480, and that the Actor's Y is between 0 and 320.

    However, if your screen IS scrollable, you'll need to place another Actor in the Scene that keeps track of the Camera coordinates. You can place the actor just outside the visible area - the lower left works nicely. You'll need to create two global properties (real) called something like CameraX and CameraY.

    Once you drag an Actor into the Scene, it becomes an INSTANCE of the Actor. Instances have access to properties of the Scene (the Actor's Prototype does not).

    Double-click on an Actor in the Scene to access its properties.
    Click the padlock to edit the behaviors of the Instance.

    In the "Camera Tracker" instance, you'll need to Constrain the Camera's OriginX to the global CameraX. Do the same for the Camera's OriginY.

    Now that you have those coordinates tracked, you simply need to check that the Actor's X is between game.CameraX and game.CameraX + 480, and that the Actor's Y is between game.CameraY and game.CameraY + 320.

    Hope this helps!
    Joe
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    If your scene is NOT scrollable, you simply need to check that the Actor's X is between 0 and 480, and that the Actor's Y is between 0 and 320.

    However, if your screen IS scrollable, you'll need to place another Actor in the Scene that keeps track of the Camera coordinates. You can place the actor just outside the visible area - the lower left works nicely. You'll need to create two global properties (real) called something like CameraX and CameraY.

    Once you drag an Actor into the Scene, it becomes an INSTANCE of the Actor. Instances have access to properties of the Scene (the Actor's Prototype does not).

    Double-click on an Actor in the Scene to access its properties.
    Click the padlock to edit the behaviors of the Instance.

    In the "Camera Tracker" instance, you'll need to Constrain the Camera's OriginX to the global CameraX. Do the same for the Camera's OriginY.

    Now that you have those coordinates tracked, you simply need to check that the Actor's X is between game.CameraX and game.CameraX + 480, and that the Actor's Y is between game.CameraY and game.CameraY + 320.

    Hope this helps!
    Joe
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    If your scene is NOT scrollable, you simply need to check that the Actor's X is between 0 and 480, and that the Actor's Y is between 0 and 320.

    However, if your screen IS scrollable, you'll need to place another Actor in the Scene that keeps track of the Camera coordinates. You can place the actor just outside the visible area - the lower left works nicely. You'll need to create two global properties (real) called something like CameraX and CameraY.

    Once you drag an Actor into the Scene, it becomes an INSTANCE of the Actor. Instances have access to properties of the Scene (the Actor's Prototype does not).

    Double-click on an Actor in the Scene to access its properties.
    Click the padlock to edit the behaviors of the Instance.

    In the "Camera Tracker" instance, you'll need to Constrain the Camera's OriginX to the global CameraX. Do the same for the Camera's OriginY.

    Now that you have those coordinates tracked, you simply need to check that the Actor's X is between game.CameraX and game.CameraX + 480, and that the Actor's Y is between game.CameraY and game.CameraY + 320.

    Hope this helps!
    Joe
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    If your scene is NOT scrollable, you simply need to check that the Actor's X is between 0 and 480, and that the Actor's Y is between 0 and 320.

    However, if your screen IS scrollable, you'll need to place another Actor in the Scene that keeps track of the Camera coordinates. You can place the actor just outside the visible area - the lower left works nicely. You'll need to create two global properties (real) called something like CameraX and CameraY.

    Once you drag an Actor into the Scene, it becomes an INSTANCE of the Actor. Instances have access to properties of the Scene (the Actor's Prototype does not).

    Double-click on an Actor in the Scene to access its properties.
    Click the padlock to edit the behaviors of the Instance.

    In the "Camera Tracker" instance, you'll need to Constrain the Camera's OriginX to the global CameraX. Do the same for the Camera's OriginY.

    Now that you have those coordinates tracked, you simply need to check that the Actor's X is between game.CameraX and game.CameraX + 480, and that the Actor's Y is between game.CameraY and game.CameraY + 320.

    Hope this helps!
    Joe
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    If your scene is NOT scrollable, you simply need to check that the Actor's X is between 0 and 480, and that the Actor's Y is between 0 and 320.

    However, if your screen IS scrollable, you'll need to place another Actor in the Scene that keeps track of the Camera coordinates. You can place the actor just outside the visible area - the lower left works nicely. You'll need to create two global properties (real) called something like CameraX and CameraY.

    Once you drag an Actor into the Scene, it becomes an INSTANCE of the Actor. Instances have access to properties of the Scene (the Actor's Prototype does not).

    Double-click on an Actor in the Scene to access its properties.
    Click the padlock to edit the behaviors of the Instance.

    In the "Camera Tracker" instance, you'll need to Constrain the Camera's OriginX to the global CameraX. Do the same for the Camera's OriginY.

    Now that you have those coordinates tracked, you simply need to check that the Actor's X is between game.CameraX and game.CameraX + 480, and that the Actor's Y is between game.CameraY and game.CameraY + 320.

    Hope this helps!
    Joe
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    If your scene is NOT scrollable, you simply need to check that the Actor's X is between 0 and 480, and that the Actor's Y is between 0 and 320.

    However, if your screen IS scrollable, you'll need to place another Actor in the Scene that keeps track of the Camera coordinates. You can place the actor just outside the visible area - the lower left works nicely. You'll need to create two global properties (real) called something like CameraX and CameraY.

    Once you drag an Actor into the Scene, it becomes an INSTANCE of the Actor. Instances have access to properties of the Scene (the Actor's Prototype does not).

    Double-click on an Actor in the Scene to access its properties.
    Click the padlock to edit the behaviors of the Instance.

    In the "Camera Tracker" instance, you'll need to Constrain the Camera's OriginX to the global CameraX. Do the same for the Camera's OriginY.

    Now that you have those coordinates tracked, you simply need to check that the Actor's X is between game.CameraX and game.CameraX + 480, and that the Actor's Y is between game.CameraY and game.CameraY + 320.

    Hope this helps!
    Joe
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    If your scene is NOT scrollable, you simply need to check that the Actor's X is between 0 and 480, and that the Actor's Y is between 0 and 320.

    However, if your screen IS scrollable, you'll need to place another Actor in the Scene that keeps track of the Camera coordinates. You can place the actor just outside the visible area - the lower left works nicely. You'll need to create two global properties (real) called something like CameraX and CameraY.

    Once you drag an Actor into the Scene, it becomes an INSTANCE of the Actor. Instances have access to properties of the Scene (the Actor's Prototype does not).

    Double-click on an Actor in the Scene to access its properties.
    Click the padlock to edit the behaviors of the Instance.

    In the "Camera Tracker" instance, you'll need to Constrain the Camera's OriginX to the global CameraX. Do the same for the Camera's OriginY.

    Now that you have those coordinates tracked, you simply need to check that the Actor's X is between game.CameraX and game.CameraX + 480, and that the Actor's Y is between game.CameraY and game.CameraY + 320.

    Hope this helps!
    Joe
  • TwistedMechTwistedMech Member Posts: 408
    good idea and one I did not think of.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    test
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey,

    If your scene is NOT scrollable, you simply need to check that the Actor's X is between 0 and 480, and that the Actor's Y is between 0 and 320.

    However, if your screen IS scrollable, you'll need to place another Actor in the Scene that keeps track of the Camera coordinates. You can place the actor just outside the visible area. You'll need to create two global properties (real) called something like CameraX and CameraY.

    Once you drag an Actor into the Scene, it becomes an INSTANCE of the Actor. Instances have access to properties of the Scene (the Actor's Prototype does not).

    Double-click on an Actor in the Scene to access its properties.
    Click the padlock to edit the behaviors of the Instance.

    In the "Camera Tracker" instance, you'll need to Constrain the Camera's OriginX to the global CameraX. Do the same for the Camera's OriginY.

    Now that you have those coordinates tracked, you simply need to check that the Actor's X is between game.CameraX and game.CameraX + 480, and that the Actor's Y is between game.CameraY and game.CameraY + 320.

    Hope this helps!
    Joe
  • JGary321JGary321 Member Posts: 1,246
    quiz
Sign In or Register to comment.