Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: metamorphium on March 28, 2010, 04:05:07 PM

Title: Distinguishing Entity from RegionEntity
Post by: metamorphium on March 28, 2010, 04:05:07 PM
Hi Mnemonic,

please, is there a way how to programatically distinugish in between the aforementioned? ent.Type always returns entity.

Thank you very much!
Title: Re: Distinguishing Entity from RegionEntity
Post by: Mnemonic on March 28, 2010, 04:47:08 PM
Entity.Region property will contain null if it's not a region entity.
Title: Re: Distinguishing Entity from RegionEntity
Post by: metamorphium on March 28, 2010, 05:01:23 PM
Thank you. Just to be sure: Even if I use dynamic region creation in entities (theora buttons)?
Title: Re: Distinguishing Entity from RegionEntity
Post by: Mnemonic on March 28, 2010, 08:10:36 PM
It doesn't matter. As long as the entity has a region assigned, it's accessible using the .Region property.
Title: Re: Distinguishing Entity from RegionEntity
Post by: metamorphium on March 28, 2010, 09:32:28 PM
so in that case it's not possible to distinguish that.

Thank you again.
Title: Re: Distinguishing Entity from RegionEntity
Post by: Mnemonic on March 28, 2010, 09:35:42 PM
I don't understand. It's legal for an entity to have both sprite and region. You can query both using script.
Title: Re: Distinguishing Entity from RegionEntity
Post by: metamorphium on March 28, 2010, 09:39:09 PM
I am traversing all scene entities in a loop layer by layer. I am making an internal index based on the fact if the node is Entity, not region entity.

Your recommendation was to test for Region attribute. If it's null, I wouldn't index. This works for regular entities / region entities. But I also have theora entities which have regions dynamically assigned so they are clickable.
These entites will never get indexed because their Region attribute is not null.