public void AddFrame(CozyTexture texture) { var frame = CozyAnimationFrame.Create(texture, 1.0f); Frames.Add(frame); TotalDelayUnits++; }
public void Modify(uint id, CozyTexture texture) { if(TextureDictionary.ContainsKey(id)) { TextureDictionary[id] = texture; } }
public static CozyAnimationFrame Create(CozyTexture texture, float delayUnits) { var animate = new CozyAnimationFrame(); animate.InitWithTexture(texture, delayUnits); return(animate); }
public virtual bool InitWithTexture(CozyTexture texture) { if (texture == null) { return(false); } Texture = texture; return(true); }
public TileButton(CozyTexture texture, Rectangle SourceRect) { PreferredHeight = 32; PreferredWidth = 32; Margin = new Starbound.UI.Thickness(3, 3, 0, 0); Content = new XNAImageResource(texture.Get()); SourcePosition = new Starbound.UI.Vector2(SourceRect.X, SourceRect.Y); SourceSize = new Starbound.UI.Vector2(SourceRect.Width, SourceRect.Height); }
public static new CozyTileSprite Create(CozyTexture texture) { var sp = new CozyTileSprite(); if(!sp.InitWithTexture(texture)) { return null; } return sp; }
public static CozySprite Create(CozyTexture texture) { var sp = new CozySprite(); if (!sp.InitWithTexture(texture)) { return(null); } return(sp); }
public CozyTexture AddImage(string path) { CozyTexture result = null; if(Textures.ContainsKey(path)) { result = Textures[path]; } else { result = new CozyTexture(path); Textures[path] = result; } return result; }
public CozyTexture AddImage(string path) { CozyTexture result = null; if (Textures.ContainsKey(path)) { result = Textures[path]; } else { result = new CozyTexture(path); Textures[path] = result; } return(result); }
public override void Update(float dt) { if (dt < 1.0f) { dt *= Animaction.Loops; uint LoopNum = (uint)dt; if (LoopNum > ExecutedLoops) { NextFrame = 0; ExecutedLoops++; } dt = dt % 1.0f; } var frames = Animaction.Frames; int numberOfFrames = frames.Count; CozyTexture frameToDisplay = null; for (int i = NextFrame; i < numberOfFrames; ++i) { float splitTime = SplitTimes[i]; if (splitTime <= dt) { CozyAnimationFrame frame = frames[i]; frameToDisplay = frame.Texture; (Target as CozySprite).Texture = frameToDisplay; NextFrame = i + 1; } else { break; } } }
public override bool InitWithTexture(CozyTexture texture) { if(!base.InitWithTexture(texture)) { return false; } return true; }
public object Clone() { var text = new CozyTexture(this._Texutre); return(text); }
public virtual bool InitWithTexture(CozyTexture texture, float delayUnits) { Texture = texture; DelayUnits = delayUnits; return true; }
public static CozyAnimationFrame Create(CozyTexture texture, float delayUnits) { var animate = new CozyAnimationFrame(); animate.InitWithTexture(texture, delayUnits); return animate; }
private Tuple<uint, CozyTiledNode> CreateTiledNodeTuple(uint id, CozyTexture texture, Rectangle rect) { return Tuple.Create<uint, CozyTiledNode>(id, CozySpriteTiled.Create(texture, rect)); }
public void Add(uint id, CozyTexture texture) { TextureDictionary[id] = texture; }
public void AddFrame(CozyTexture texture) { var frame = CozyAnimationFrame.Create(texture, 1.0f); Frames.Add(frame); TotalDelayUnits ++; }
public object Clone() { var text = new CozyTexture(this._Texutre); return text; }
public virtual bool InitWithTexture(CozyTexture texture, float delayUnits) { Texture = texture; DelayUnits = delayUnits; return(true); }
public virtual bool InitWithTexture(CozyTexture texture) { if (texture == null) return false; Texture = texture; return true; }