protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); content = this.CreateContentManager(base.Content.ServiceProvider, base.Content.RootDirectory); chatboxtexture = content.Load <Texture2D>("chatBox"); smallFont = Content.Load <SpriteFont>("SmallFont.zh-CN"); ChatBox.emojiTexture = content.Load <Texture2D>("emojis"); staminaRect = new Texture2D(GraphicsDevice, 1, 1, false, SurfaceFormat.Color); Game1.options = new Options(); Color[] colors = new Color[staminaRect.Width * staminaRect.Height]; staminaRect.GetData(colors); for (int i = 0; i < colors.Length; i++) { Color color = new Color(255f, 255f, 255f, 1f); colors[i] = color; } staminaRect.SetData(colors); }
public FarmerRenderer() { NetFields.AddFields(textureName, heightOffset, eyes, skin, shoes, shirt, pants); farmerTextureManager = Game1.content.CreateTemporary(); textureName.fieldChangeVisibleEvent += delegate { _spriteDirty = true; _baseTextureDirty = true; }; eyes.fieldChangeVisibleEvent += delegate { _spriteDirty = true; _eyesDirty = true; }; skin.fieldChangeVisibleEvent += delegate { _spriteDirty = true; _skinDirty = true; _shirtDirty = true; }; shoes.fieldChangeVisibleEvent += delegate { _spriteDirty = true; _shoesDirty = true; }; shirt.fieldChangeVisibleEvent += delegate { _spriteDirty = true; _shirtDirty = true; }; pants.fieldChangeVisibleEvent += delegate { _spriteDirty = true; _pantsDirty = true; }; _spriteDirty = true; _baseTextureDirty = true; }
public SocialNPC(AnimatedSprite sprite, Vector2 position, int facingDir, string name, LocalizedContentManager content = null) : base(sprite, position, 2, name) { this.faceDirection(facingDir); this.DefaultPosition = position; this.defaultFacingDirection = facingDir; this.lastCrossroad = new Microsoft.Xna.Framework.Rectangle((int)position.X, (int)position.Y + 64, 64, 64); if (content == null) { return; } try { this.Portrait = content.Load <Texture2D>("Portraits\\" + name); } catch (Exception ex) { } }