public void Draw(Transform2 parentTransform) { var modifiedTransform = _transform; modifiedTransform.Location = modifiedTransform.Location.MoveInDirection(_transform.Rotation.Value, _distanceTravled); if (GameWorld.Map.Exists(GameWorld.Map.MapPositionToTile(new Vector2(modifiedTransform.Location.X, modifiedTransform.Location.Y + 24)))) { _tile = GameWorld.Map.MapPositionToTile(new Vector2(modifiedTransform.Location.X, modifiedTransform.Location.Y + 24)); } else { IsDone = true; } modifiedTransform += parentTransform; UI.SpriteBatch.Draw(texture: _texture, destinationRectangle: UI.ScaleRectangle(modifiedTransform.ToRectangle()), sourceRectangle: null, color: UiColors.Gunshot_TargetedShotVisual, rotation: _transform.Rotation.Value - (float)(Math.PI / 2), origin: new Vector2(1, 1), effects: SpriteEffects.None, layerDepth: 0.0f); }
public static void DrawRotatedFromCenter(string name, Transform2 transform) { var resource = Resources.Load <Texture2D>(name); var x = transform.Rotation.Value; _spriteBatch.Draw(resource, null, ScaleRectangle(transform.ToRectangle()), null, new Vector2(resource.Width / 2, resource.Height / 2), transform.Rotation.Value * .017453292519f, new Vector2(1, 1)); }
public ImageTextButton(string text, string basic, string hover, string press, Transform2 transform, Action onClick, Func <bool> isVisible) : base(transform.ToRectangle()) { _isVisible = isVisible; _button = new ImageButton(basic, hover, press, transform, onClick, _isVisible); _label = new Label { BackgroundColor = Color.Transparent, Text = text, Transform = transform.WithPadding(8, 8), TextColor = Color.White }; }
public static void DrawWithSpriteEffects(string imageName, Transform2 transform, Color tint, SpriteEffects effects) { SpriteBatch.Draw(texture: Resources.Load <Texture2D>(imageName), destinationRectangle: ScaleRectangle(transform.ToRectangle()), sourceRectangle: null, color: tint, rotation: 0.0f, origin: null, effects: effects, layerDepth: 0.0f); }
public ImageButton(string basic, string hover, string press, Transform2 transform, Action onClick, Func <bool> isVisible) : base(transform.ToRectangle()) { _basic = basic; _hover = hover; _press = press; _transform = transform; _isVisible = isVisible; OnClick = onClick; _current = _basic; }
public ImageTextButton CreateButton() { return(new ImageTextButton(_transform.ToRectangle(), () => { if (!CurrentGameState.HasViewedItem(_dilemma)) { Event.Publish(new ItemViewed(_dilemma)); } Scene.NavigateTo(new DeductionScene(GameResources.GetPonderText(_dilemma), _deductions.Where(x => x.IsActive()).ToList())); }, GameResources.GetPonderText(_dilemma), "Pondering/DilemmaCard", "Pondering/DilemmaCard-Hover", "Pondering/DilemmaCard-Press")); }
public ExpandingImageButton(string basic, string hover, string press, Transform2 transform, Size2 sizeIncrease, Action onClick, Func <bool> isVisible) : base(transform.ToRectangle()) { _basic = basic; _hover = hover; _press = press; _expandedTransform = new Transform2( new Vector2(transform.Location.X - sizeIncrease.Width / 2, transform.Location.Y - sizeIncrease.Height / 2), new Size2(transform.Size.Width + sizeIncrease.Width, transform.Size.Height + sizeIncrease.Height)); _baseTransform = transform; _onClick = onClick; _isVisible = isVisible; _current = _basic; _currentTransform = _baseTransform; }
public SingleImageButton(string image, Color hover, Color press, Transform2 transform, Action onClick) : base(transform.ToRectangle()) { _image = image; _hover = hover; _press = press; _transform = transform; _onClick = onClick; _current = new ColoredRectangle(); _current.Color = Color.Transparent; _current.Transform = transform; }
public ImageWithDescription(string image, string description, Transform2 transform) : base(transform.ToRectangle(), true, 1) { _image = image; _label = new Label { BackgroundColor = Color.FromNonPremultiplied(32, 32, 32, 150), TextColor = Color.White, Transform = transform, Font = "Fonts/12", Text = description }; _transform = transform; }
public static void Draw(Texture2D texture, Transform2 transform) { Draw(texture, transform.ToRectangle()); }
public static void Draw(string name, Transform2 transform) { Draw(name, transform.ToRectangle()); }
public static void Draw(string imageName, Transform2 transform, Color tint) { _spriteBatch.Draw(Resources.Load <Texture2D>(imageName), ScaleRectangle(transform.ToRectangle()), tint); }
private void GenerateTexture() { Resources.Dispose(_background); _background = new RectangleTexture(transform.ToRectangle(), Color).Create(); }
public ColoredRectangle() { color = Color.Orange; transform = new Transform2(new Size2(400, 100)); _background = new RectangleTexture(transform.ToRectangle(), Color).Create(); }
public static void DrawCentered(string imageName, Transform2 transform) { DrawCenteredWithOffset(imageName, transform.ToRectangle().Size.ToVector2(), transform.Location); }
public static void Draw(Texture2D texture, Transform2 transform) { SpriteBatch.Draw(texture, ScaleRectangle(transform.ToRectangle()), Color.White); }