Example #1
0
        //Attaches the Image Holder to the front of the list and current image is updated with it.
        public void attachImg(Image.ImageName imageName)
        {
            Image image = (Image)ImageManager.find(imageName);

            Debug.Assert(image != null);

            ImageHolder imageHolder = new ImageHolder(image);

            Debug.Assert(imageHolder != null);

            SLink.addToFront(ref cImgList, imageHolder);

            cCurrImg = imageHolder;
        }
Example #2
0
        // Clear the object

        public void wash()
        {
            this.spriteName  = SpriteName.Uninitilized;
            this.spriteImage = ImageManager.find(Image.ImageName.Uninitilized);

            Debug.Assert(spriteImage != null);

            this.x     = 0.0f;
            this.y     = 0.0f;
            this.sx    = 1.0f;
            this.sy    = 1.0f;
            this.angle = 0.0f;

            this.azulSprite.Swap(spriteImage.getAzulTexture(), spriteImage.imageRect, cDefScreenRect, cDefColor);
            this.spriteColor = cDefColor;
            this.screenRect.Set(cDefScreenRect);
        }
        public static Sprite add(Sprite.SpriteName spriteName, Image.ImageName spriteImageName, float x, float y, float width, float height, Azul.Color azulColor)
        {
            SpriteManager spriteMInstance = SpriteManager.getSingletonInstance();

            Debug.Assert(spriteMInstance != null);

            Sprite nodeAdded = (Sprite)spriteMInstance.genericAdd();

            Debug.Assert(nodeAdded != null);
            //set the attributes of the Image node
            Image image = ImageManager.find(spriteImageName);

            Debug.Assert(image != null);

            nodeAdded.setAll(spriteName, image, x, y, width, height, azulColor);

            return(nodeAdded);
        }
Example #4
0
        //default constructor

        public Sprite() : base()
        {
            this.spriteName = Sprite.SpriteName.Uninitilized;

            this.spriteImage = ImageManager.find(Image.ImageName.NullObject);
            Debug.Assert(this.spriteImage != null);

            this.spriteColor = new Azul.Color();
            Debug.Assert(this.spriteColor != null);

            this.screenRect = new Azul.Rect(cDefScreenRect);
            Debug.Assert(screenRect != null);

            this.azulSprite = new Azul.Sprite(spriteImage.getAzulTexture(), spriteImage.imageRect, cDefScreenRect, this.spriteColor);
            Debug.Assert(this.azulSprite != null);

            this.x     = azulSprite.x;
            this.y     = azulSprite.y;
            this.sx    = azulSprite.sx;
            this.sy    = azulSprite.sy;
            this.angle = azulSprite.angle;
        }