public static LNSprite GInitWithFrameStruct(LNFrameStruct fs) { LNSprite sprite = new LNSprite(); sprite.InitWithFrameStruct(fs); return(sprite); }
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); }
public static LNFrameStruct InitWithImageName(string imgName) { DefImage image = LNDataCache.ImageByKey(imgName); LNFrameStruct struct2 = new LNFrameStruct(); if (image.maskColor == null) { struct2._texture = LTextures.LoadTexture(image.fileName, Loon.Core.Graphics.Opengl.LTexture.Format.LINEAR); } else { struct2._texture = TextureUtils.FilterColor(image.fileName, image.maskColor, Loon.Core.Graphics.Opengl.LTexture.Format.LINEAR); } struct2._state = image.blend; struct2._textCoords = image.pos; struct2._orig_width = image.orig.X(); struct2._orig_height = image.orig.Y(); struct2._size_width = image.size.X(); struct2._size_height = image.size.Y(); struct2._anchor = image.anchor; struct2._place = image.place; return(struct2); }
public void AddFrameStruct(string fs, float time) { LNFrameStruct item = Node.LNDataCache.GetFrameStruct(fs); CollectionUtils.Add(this._fsList, item); CollectionUtils.Add(this._timeList, time); this._totalDuration += time; }
public void InitWithFrameStruct(LNFrameStruct fs) { this._texture = fs._texture; blendState = fs._state; base._left = fs._textCoords.X(); base._top = fs._textCoords.Y(); base._orig_width = fs._orig_width; base._orig_height = fs._orig_height; base.SetNodeSize(fs._size_width, fs._size_height); base._anchor.Set(fs._anchor); }
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); }
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); }
public static LNFrameStruct GetFrameStruct(string key) { if (!initCache) { InitDataDefinitions(); } DefImage img = ImageByKey(key); if (img != null) { return(LNFrameStruct.InitWithImage(img)); } return(null); }
public static LNFrameStruct InitWithImage(DefImage img) { LNFrameStruct struct2 = new LNFrameStruct(); if (img.maskColor == null) { struct2._texture = LTextures.LoadTexture(img.fileName, Loon.Core.Graphics.Opengl.LTexture.Format.LINEAR); } else { struct2._texture = TextureUtils.FilterColor(img.fileName, img.maskColor, Loon.Core.Graphics.Opengl.LTexture.Format.LINEAR); } struct2._state = img.blend; struct2._textCoords = img.pos; struct2._orig_width = img.orig.X(); struct2._orig_height = img.orig.Y(); struct2._size_width = img.size.X(); struct2._size_height = img.size.Y(); struct2._anchor = img.anchor; struct2._place = img.place; return struct2; }
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); } }
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); }
public static LNSprite GInitWithFrameStruct(LNFrameStruct fs) { LNSprite sprite = new LNSprite(); sprite.InitWithFrameStruct(fs); return sprite; }
public void InitWithFrameStruct(LNFrameStruct fs) { this._texture = fs._texture; blendState = fs._state; base._left = fs._textCoords.X(); base._top = fs._textCoords.Y(); base._orig_width = fs._orig_width; base._orig_height = fs._orig_height; base.SetNodeSize(fs._size_width,fs._size_height); base._anchor.Set(fs._anchor); }