2D Toolkit Forum

2D Toolkit => Support => Topic started by: nachobeard on January 14, 2018, 10:51:58 pm

Title: extractRegion in sprite definition - ok to use?
Post by: nachobeard on January 14, 2018, 10:51:58 pm
Hello,

my question refers to the following members of tk2dSpriteDefinition:

public bool extractRegion;
public int regionX, regionY, regionW, regionH;


are they safe to use within a non-editor script?
I'm using it to find the size of the sprite at runtime, but there's a comment implying that they may only be intended to use from the editor side and it sounds to me like they could not be filled in when running outside the editor:

/// Speficies if this texture is extracted from a larger texture source, for instance an atlas. This is used in the inspector.


that's all

many thanks
Title: Re: extractRegion in sprite definition - ok to use?
Post by: unikronsoftware on January 17, 2018, 10:24:38 pm
Hi,

Quick answer - Yes it is safe to use at runtime.

The comment is relating to the fact that it is only ever used in the editor to draw textures in the picker.