Hello Guest

Author Topic: extractRegion in sprite definition - ok to use?  (Read 4481 times)

nachobeard

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 28
    • View Profile
extractRegion in sprite definition - ok to use?
« 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: extractRegion in sprite definition - ok to use?
« Reply #1 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.