The Daily Click ::. Forums ::. Klik Coding Help ::. Layer Object Help
 

Post Reply  Post Oekaki 
 

Posted By Message

jamesh



Registered
  28/02/2012 15:24:25
Points
  381
4th March, 2012 at 04/03/2012 13:51:31 -

Hi

Is there any way to make the layer object only apply to a specific group of objects?

I am fixing a little game and would like certain objects (trees, houses, etc) to be sorted by their Y Coordinate, but have others (eg the Cursor) always at the front.

Any help would be much appreciated

Thanks

James

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
4th March, 2012 at 04/03/2012 23:39:38 -

There are lots of ways to do this. I'd have to take a look at your mfa to see how your code works but you can just put all the objects you want in front on a separate layer. Of if you want them on the same layer for whatever reason, just add the event "ALWAYS: Move Cursor to Front".

 
n/a

jamesh



Registered
  28/02/2012 15:24:25
Points
  381
5th March, 2012 at 05/03/2012 12:48:16 -

What I'm currently doing is sort > by Y increasing (or decreasing, I forget which right now). I've got an Always move cursor to front event, which was effective before I tried the layer object...

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
5th March, 2012 at 05/03/2012 15:02:04 -

Yeah, you could do what Chris suggests and have it so that whenever the cursor is overlapping a member of that group of objects (ex. Neutral, Enemies, etc) than move the cursor in front of said object.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Kai Proton



Registered
  31/01/2005
Points
  201

Wii Owner
14th March, 2012 at 14/03/2012 20:51:59 -

How about..
You have the cursor in its own layer, and have an invisible Active object following its XY on the layer you want,

then the cursor Layer is always where you want it,,


 
----------------------
Time for a Sexy Party!
----------------------

SolarB



Registered
  26/12/2011
Points
  564
15th March, 2012 at 15/03/2012 00:26:34 -

Have your cursor on a separate layer and whenever you need it to perform a function on an object on another layer just use:

always
-> set cursor to layer 'x'

cursor is over 'y' (or whatever)
-> perform function

always
-> set cursor to layer 'top'

 
My Open Source Examples: http://bit.ly/YyUFUh
   

Post Reply



 



Advertisement

Worth A Click