Example #1
0
 private int GetYOffset(GameContainer gc)
 {
     if (this.centeredOn != null)
     {
         return((gc.GetHeight() - this.centeredOn.GetHeight()) / 2 - this.centeredOn.GetY());
     }
     return(0);
 }
Example #2
0
        //    private void renderActorsOfType(Graphics graphics, Class<? extends Actor> type)
        //{
        //    for (Actor actor : this.actors) {
        //    if (type.isInstance(actor))
        //    {
        //        Animation animation = actor.getAnimation();
        //        if (animation != null)
        //        {
        //            animation.draw(actor.getX(), actor.getY());
        //        }
        //        else
        //        {
        //            throw new IllegalStateException("Animation missing for" + actor.getClass().getName());
        //        }
        //    }
        //}
        //    }

        private void RenderInventory(GameContainer gc)
        {
            int x;

            if (this.inventory != null)
            {
                x = 4;


                throw new NotImplementedException();
                //graphics.setColor(Color.BLACK);
                //graphics.fillRect(0.0F, gc.GetHeight() - 24, gc.GetWidth(), gc.GetHeight());
                foreach (Item item in this.inventory)
                {
                    item.GetAnimation().Draw(x, gc.GetHeight() - 20, 16, 16);
                    x += item.GetWidth() + 4;
                }

                //graphics.setColor(color);
                //        }
                //    }
            }
        }