Exemple #1
0
        public void InitButtonWithTextureTwinkle(string fsName1, string fsName2)
        {
            this.fs = LNDataCache.GetFrameStruct(fsName1);
            LNAnimation anim   = new LNAnimation("Frame", 0.1f, fsName1, fsName2);
            LNSprite    sprite = new LNSprite();

            sprite.AddAnimation(anim);
            sprite.SetFrame("Frame", 0);
            CollectionUtils.Put(this._buttonElement, "Image", sprite);
            base.AddNode(sprite, 0);
            base.SetNodeSize(sprite.GetWidth(), sprite.GetHeight());
            base.SetAnchor(new Vector2f(base.GetWidth() / 2f,
                                        base.GetHeight() / 2f));
            LNAction action = LNSequence.Action(LNFrameAction.Action("Frame", 1));

            action.AssignTarget(sprite);
            LNAction action2 = LNSequence.Action(LNFrameAction.Action("Frame", 0));

            action2.AssignTarget(sprite);
            LNAction action3 = LNSequence.Action(
                LNRepeat.Action(LNAnimate.Action(anim), 1),
                LNFrameAction.Action("Frame", 0));

            action3.AssignTarget(sprite);
            CollectionUtils.Put(this._touchBeganAction, "Image", action);
            CollectionUtils.Put(this._touchMoveOutAction, "Image", action2);
            CollectionUtils.Put(this._touchClickedAction, "Image", action3);
        }
Exemple #2
0
 public LNLabelAtlas(string fsName, LNLabelAtlas.LabelType type, string text,
                     char startchar, int itemWidth, int itemHeight, int charWidth) : base(fsName, itemWidth, itemHeight)
 {
     this.fs         = LNDataCache.GetFrameStruct(fsName);
     base._left      = (int)this.fs._textCoords.x;
     base._top       = (int)this.fs._textCoords.y;
     this._type      = type;
     this._charWidth = charWidth;
     this._startchar = startchar;
     this.SetString(text);
 }
Exemple #3
0
 public LNAtlasNode(string fsName, int tileWidth, int tileHeight)
 {
     try {
         this._itemWidth  = tileWidth;
         this._itemHeight = tileHeight;
         LTexture texture = LNDataCache.GetFrameStruct(fsName)._texture;
         this._itemsPerRow    = texture.GetWidth() / tileWidth;
         this._itemsPerColumn = texture.GetHeight() / tileHeight;
         this._textureAtlas   = new LNTextureAtlas(texture, this._itemsPerRow
                                                   * this._itemsPerColumn);
     } catch (Exception) {
         throw new Exception(
                   "LNAtlasNode Exception in the data load : " + fsName);
     }
 }
Exemple #4
0
        public LNSprite(string fsName)
            : base()
        {
            this._ans = null;
            LNFrameStruct struc0 = LNDataCache.GetFrameStruct(fsName);

            if (struc0 == null)
            {
                throw new Exception("");
            }
            this._texture     = struc0._texture;
            base._left        = struc0._textCoords.X();
            base._top         = struc0._textCoords.Y();
            base._orig_width  = struc0._orig_width;
            base._orig_height = struc0._orig_height;
            base.SetNodeSize(struc0._size_width, struc0._size_height);
            base._anchor.Set(struc0._anchor);
            blendState = struc0._state;
            if (!struc0._place.Equals(0, 0))
            {
                SetPosition(struc0._place);
            }
        }
Exemple #5
0
 public static LNSprite GInitWithFrameStruct(string fsName)
 {
     return(GInitWithFrameStruct(LNDataCache.GetFrameStruct(fsName)));
 }