/** Returns whether this layer reacts to clicks and touches. If a layer is interactive, it will * respond to {@link #hitTest}, which forms the basis for the click and touch processing * provided by the {@code Dispatcher}s.*/ public boolean interactive() { return isSet(Flag.INTERACTIVE); }
/** Returns true if this layer is visible (i.e. it is being rendered). */ public boolean visible() { return isSet(Flag.VISIBLE); }
/** Returns the y-component of the layer's origin. */ public float originY () { if (isSet(Flag.ODIRTY)) { float height = height(); if (height > 0) { this.originX = origin.ox(width()); this.originY = origin.oy(height); setFlag(Flag.ODIRTY, false); } } return originY; } /** Writes this layer's origin into {@code into}.
/** Returns the x-component of the layer's origin. */ public float originX () { if (isSet(Flag.ODIRTY)) { float width = width(); if (width > 0) { this.originX = origin.ox(width); this.originY = origin.oy(height()); setFlag(Flag.ODIRTY, false); } } return originX; } /** Returns the y-component of the layer's origin. */
/** * Returns the layer's current transformation matrix. If any changes have been made to the * layer's scale, rotation or translation, they will be applied to the transform matrix before it * is returned. * * <p><em>Note:</em> any direct modifications to this matrix <em>except</em> modifications to its * translation, will be overwritten if a call is subsequently made to {@link #setScale(float)}, * {@link #setScale(float,float)}, {@link #setScaleX}, {@link #setScaleY} or {@link #setRotation}. * If you intend to manipulate a layer's transform matrix directly, <em>do not</em> call those * other methods. Also do not expect {@link #scaleX}, {@link #scaleY}, or {@link #rotation} to * reflect the direct changes you've made to the transform matrix. They will not. </p> */ public AffineTransform transform() { if (isSet(Flag.XFDIRTY)) { float sina = FloatMath.sin(rotation), cosa = FloatMath.cos(rotation); float m00 = cosa * scaleX, m01 = sina * scaleX; float m10 = -sina * scaleY, m11 = cosa * scaleY; float tx = transform.tx(), ty = transform.ty(); transform.setTransform(m00, m01, m10, m11, tx, ty); setFlag(Flag.XFDIRTY, false); } return transform; }