Class TextureUnit


  • public abstract class TextureUnit
    extends Object
    A texture unit is the base part of a material.
    Author:
    Grégory Van Den Borre
    • Constructor Detail

      • TextureUnit

        protected TextureUnit()
        Protected constructor, only called from children.
    • Method Detail

      • setTexture

        public final TextureUnit setTexture​(String path)
        Set a new texture.
        Parameters:
        path - Image path.
        Returns:
        This object.
      • setTextureAnimated

        public abstract TextureUnit setTextureAnimated​(String basePath,
                                                       int numberOfFrames,
                                                       int duration)
        Parameters:
        basePath - Image path, expected format is path/name.extension, and the files will be path/nameX.extension, X being the image number(0,1,...). i.e. for files img0.tga, img1.tga..., path is img.tga.
        numberOfFrames - Number of frames to play.
        duration - Animation duration, in seconds.
        Returns:
        This object.
      • setColorOperation

        public abstract void setColorOperation​(TextureUnit.ColorOperation op)
        Set the unit color operation.
        Parameters:
        op - Color operation.
      • scroll

        public abstract void scroll​(float x,
                                    float y)
        Set the unit animation scroll speed.
        Parameters:
        x - Animation X speed.
        y - Animation Y speed.
      • setScale

        public final void setScale​(float scale)
        Scale uniformly the texture.
        Parameters:
        scale - Scale factor.
      • setScale

        public final void setScale​(float xScale,
                                   float yScale)
        Scale the texture.
        Parameters:
        xScale - Scale factor for width.
        yScale - Scale factor for height.
      • setScaleImpl

        protected abstract void setScaleImpl​(float xScale,
                                             float yScale)
        Call implementation to set the scale.
        Parameters:
        xScale - Width scale.
        yScale - Height scale.
      • setTextureImpl

        protected abstract void setTextureImpl​(String path)
        Call implementation to set the texture.
        Parameters:
        path - Image path.
      • setCoordinateSet

        public abstract void setCoordinateSet​(int set)
      • setColor

        public final void setColor​(be.yildizgames.module.color.Color color)