public void refresh() { item_ = component_.getItem(slot_); if (item_ != null) { count_.text_ = "" + item_.item.number_; count_.pack(); count_.loc_ = new Vector2(buttonSize) - count_.size; } }
public ItemButton(GameEntity item) : base(Locator.getTextureManager().loadTexture("tile32"), Services.PostCategory.UNUSED) { item_ = item; count_ = new Text("" + item.item.number_, false); count_.parent_ = this; count_.pack(); count_.loc_ = new Vector2(buttonSize) - count_.size; }