public SpatialComponent(GameEntity entity, SpatialComponent parent, Vector2 translation, float rotation, Vector2 scale) : base(entity) { parent_ = parent; translation_ = translation; rotation_ = rotation; scale_ = scale; }
public SpatialComponent(GameEntity entity, SpatialComponent parent) : base(entity) { parent_ = parent; translation_ = Vector2.Zero; rotation_ = 0f; scale_ = Vector2.One; }
public override Component deepCopy(GameEntity entity) { SpatialComponent c = new SpatialComponent(entity); c.parent_ = parent_; c.scale_ = scale_; c.rotation_ = rotation_; c.translation_ = translation_; return(c); }
public void render(SpriteBatch spriteBatch) { if (texture_id_ >= -1 && entity_.spatial != null) { SpatialComponent spatial = entity_.spatial; spriteBatch.Draw( Locator.getTextureManager().getTexture(texture_id_), new Vector2(spatial.w_translation.X, spatial.w_translation.Y), null, color_, spatial.w_rotation, origin_, spatial.w_scale, SpriteEffects.None, layer_ ); } }
public override Component deepCopy(GameEntity entity) { SpatialComponent c = new SpatialComponent(entity); c.parent_ = parent_; c.scale_ = scale_; c.rotation_ = rotation_; c.translation_ = translation_; return c; }
private void remove(SpatialComponent spatial) { spatials_.Remove(spatial); }
private void add(SpatialComponent spatial) { spatials_.Add(spatial); }