public GameObject(World world, String name, String textureName, Vector2 position, Vector2 position2, float width, float height, BodyType type, bool drawable, BodyShape shape) { this.Name = name; if (textureName != null) { this.texture = EngineContentManager.GetTexture(textureName); } this.textureName = textureName; this.position = position; this.position2 = position2; this.width = width; this.height = height; this.type = type; this.drawable = drawable; this.shape = shape; if (world != null) { CreateBody(world); this.body.BodyType = type; body.CollisionCategories = Category.All; } else { body = null; } }
public Button(String name, String text, Vector2 position, int width, int height, Control alignedTo, Texture2D image, Texture2D hoverImage, Texture2D heldImage) : base(position, width, height, alignedTo, new Dictionary <string, Texture2D> { { "image", image }, { "hoverImage", hoverImage }, { "heldImage", heldImage } }) { this.currentImage = Images["image"]; this.font = EngineContentManager.GetXNAContent().Load <SpriteFont>("Visitor"); this.text = text; }
public Button(String name, String text, Vector2 position, int width, int height, Control alignedTo, Color color, Color hoverColor, Color heldColor) : base(position, width, height, alignedTo, new Dictionary <string, Texture2D> { { "image", DrawUtilities.GetWhitePixelTexture() }, { "hoverImage", DrawUtilities.GetWhitePixelTexture() }, { "heldImage", DrawUtilities.GetWhitePixelTexture() } }) { this.currentImage = Images["image"]; this.font = EngineContentManager.GetXNAContent().Load <SpriteFont>("Visitor"); this.text = text; this.color = color; this.heldColor = heldColor; this.hoverColor = hoverColor; this.currentColor = color; }