public CharacterRenderer(Character character, Camera camera, Texture2D texture, SpriteFont font) : base(character, camera, texture, font, new Point(64, 64), 50, new Point(32, 55), 2f) { this.character = character; animation = Animation.Idle; direction = Direction.South; frameCount = 1; animationRow = 8; }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); Camera = new Camera(GraphicsDevice.Viewport.Bounds.Size); font = Game.Content.Load<SpriteFont>("HudFont"); background = Game.Content.Load<Texture2D>("background"); game.Window.ClientSizeChanged += (s,e) => Camera.Resize(GraphicsDevice.Viewport.Bounds.Size); }
/// <summary> /// Initialisierung des Item Renderers /// </summary> /// <param name="item">Item Referenz</param> /// <param name="camera">Kamera Referenz</param> /// <param name="texture">Textur Referenz</param> /// <param name="font">Font</param> /// <param name="frameSize">Größe eines Frames in Pixel</param> /// <param name="frameTime">Anzahl Millisekunden pro Frame</param> /// <param name="itemOffset">Mittelpunkt des Items innerhalb des Frames</param> /// <param name="frameScale">Skalierung</param> public ItemRenderer(Item item, Camera camera, Texture2D texture, SpriteFont font, Point frameSize, int frameTime, Point itemOffset, float frameScale) { this.Item = item; this.Camera = camera; this.Texture = texture; this.Font = font; this.FrameSize = frameSize; this.FrameTime = frameTime; this.ItemOffset = itemOffset; this.FrameScale = frameScale; }
public SimpleItemRenderer(Item item, Camera camera, Texture2D texture, SpriteFont font) : base(item, camera, texture, font, new Point(32, 32), 70, new Point(16,26), 1f) { frameCount = 8; }