示例#1
0
 public SpatialComponent(GameEntity entity, SpatialComponent parent, Vector2 translation, float rotation, Vector2 scale)
     : base(entity)
 {
     parent_      = parent;
     translation_ = translation;
     rotation_    = rotation;
     scale_       = scale;
 }
示例#2
0
 public SpatialComponent(GameEntity entity, SpatialComponent parent)
     : base(entity)
 {
     parent_      = parent;
     translation_ = Vector2.Zero;
     rotation_    = 0f;
     scale_       = Vector2.One;
 }
示例#3
0
 public SpatialComponent(GameEntity entity, SpatialComponent parent)
     : base(entity)
 {
     parent_ = parent;
     translation_ = Vector2.Zero;
     rotation_ = 0f;
     scale_ = Vector2.One;
 }
示例#4
0
 public SpatialComponent(GameEntity entity, SpatialComponent parent, Vector2 translation, float rotation, Vector2 scale)
     : base(entity)
 {
     parent_ = parent;
     translation_ = translation;
     rotation_ = rotation;
     scale_ = scale;
 }
示例#5
0
        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);
        }
示例#6
0
 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_
             );
     }
 }
示例#7
0
 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;
 }
示例#8
0
 private void remove(SpatialComponent spatial)
 {
     spatials_.Remove(spatial);
 }
示例#9
0
 private void add(SpatialComponent spatial)
 {
     spatials_.Add(spatial);
 }