예제 #1
0
 internal override void runOnNode(DNode node)
 {
     if (resize)
     {
         DSpriteNode spriteNode = (DSpriteNode)node;
         //spriteNode.size = new Vector2(texture2D.Width, texture2D.Height);
     }
 }
예제 #2
0
        internal override void evaluateWithNode(DNode node, float dt)
        {
            if (elapsed + dt > duration)
            {
                dt = duration - elapsed;
            }

            elapsed += dt;

            DSpriteNode spriteNode = (DSpriteNode)node;

            spriteNode.texture = texture2D;
        }
예제 #3
0
        internal void setIcon(string assetName)
        {
            Texture2D   texture = DGame.current.contentManager.loadTexture2D(assetName);
            DSpriteNode newIcon = new DSpriteNode(texture, color, texture.Bounds.Size.ToVector2());

            newIcon.setScaleToFit(size);

            newIcon.position = new Vector2(size.X / 2.0f, size.Y / 2.0f);

            addChild(newIcon);
            icon?.removeFromParent();
            icon = newIcon;
        }
예제 #4
0
        internal override void evaluateWithNode(DNode node, float dt)
        {
            if (elapsed + dt > duration)
            {
                dt = duration - elapsed;
            }

            elapsed += dt;

            float t1 = timingFunction(elapsed / duration, 0, 1, 1) * duration;

            DSpriteNode spriteNode = (DSpriteNode)node;

            spriteNode.size += speed * (t1 - t0);

            t0 = t1;
        }
        internal override void runOnNode(DNode node)
        {
            DSpriteNode spriteNode = (DSpriteNode)node;

            speed = (size - spriteNode.size) / duration;
        }