How to use region types rather than hardcoding detection for every region?


  • Posts: 165
In the run and jump kit for flash, code is used to determine if a region is water by checking of the word "water" is in its name. I haven't been able to find equivalent code for iOS, and without it it is impossible to use events to detect if an actor enters a region of a type. I am having to hard code collision events for every single "water" region in the game, leaving me with a behavior with about 30 identical events for every individual region shape...

Does anyone know how I could go about detecting regions of a type, rather than having to check for every specific region in the game individually?


  • Posts: 31
I want to know this also, cause i have a lot of regions in my game and this will help me a lot.

PD: Oh but my question is in stencyl for PC not for IOS sry.

« Last Edit: August 01, 2012, 02:47:22 pm by Savager »


  • Posts: 16
Bump! I would also like to know the answer to this


  • Posts: 33

I think this would also be a great feature.

Due to the nature of the visual style used in my project (i.e. a block/grid/pixel style) I've been trying to replicate a similar solution using actors with a square collision shape but having limited success; the region method works much better but is limited by only working within a single region!

If there was a built in mechanism for 'Region By Type' or similar, that would be great.

I notice that the water/ladder packs around Stencylforge employ the "IF 'ladder' is in name of Region THEN bla bla bla" logic. Looking around the forums suggests that a more universal feature would be of great benefit!