public void createConmunication(IList <Conmunication> conmunications) { GameSetting.isGamePause = true; this.conmunications.Clear(); foreach (var item in conmunications) { this.conmunications.Enqueue(item); } var windowFrame = Core.content.Load <Texture2D>("UI/textBox"); var iconFrame = Core.content.Load <Texture2D>("UI/frame_grey"); var canvas = Core.scene.findEntity("ui").getComponent <UICanvas>(); var back = new SubtextureDrawable(new Nez.Textures.Subtexture(windowFrame)); conmunicateTable = canvas.stage.addElement(new Table()); conmunicateTable.setFillParent(true).bottom(); var table = conmunicateTable.add(new Table()).center().getElement <Table>(); var image = new ImageButton(new SubtextureDrawable(this.conmunications.Peek().texture)); image.setBackground(new SubtextureDrawable(iconFrame)); table.add(image).width(130).height(130).pad(50); LabelStyle labelStyle = new LabelStyle(new Color(255, 255, 255, 0)); Label label = new Label(this.conmunications.Peek().content, labelStyle); label.setWrap(true); label.setFontScale(2f); table.add(label).pad(50).width(500).left().top(); table.add(new Label("继续:空格", labelStyle)).bottom().right().setPadBottom(40).setPadRight(50); table.setBackground(back); }
private void initRecipeTable() { recipeTable = new Table(); var back = new SubtextureDrawable(new Nez.Textures.Subtexture(windowFrame)); back.setPadding(0, 620, 0, 540); recipeTable.setBackground(back); recipeTable.setSize(540, 620); allContain.add(recipeTable).top().left().pad(25); recipeTable.add(new Label("配方")); recipeContentTable = new Table(); ButtonGroup buttonGroup = new ButtonGroup(); foreach (var recipe in player.recipes) { var button = new TextButton(recipe.name, Skin.createDefaultSkin()); buttonGroup.add(button); recipeContentTable.add(button).width(50).height(20); button.onClicked += obj => { allContain.clear(); initRecipeTable(); //allContain.removeElement(recipeDetailTable); initRecipeDetailTable(recipe); }; } recipeScrollPane = new ScrollPane(recipeContentTable, Skin.createDefaultSkin()); recipeTable.addElement(recipeScrollPane).setPosition(30, 30); recipeScrollPane.setSize(500, 540); }
public ItemSprite(ContentManager content, ItemSpriteSheet itemType) { var texture = content.Load <Texture2D>(ContentPaths.Assets.items); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 16, 16); this.Sprite = frames[(int)itemType]; }
private void initializeItemTable() { itemTable = new Table(); var windowFrame = Core.content.Load <Texture2D>("UI/window_frame_grey"); var buttonFrame = Core.content.Load <Texture2D>("UI/frame_grey"); var back = new SubtextureDrawable(new Nez.Textures.Subtexture(windowFrame)); back.setPadding(0, 620, 0, 540); itemTable.setBackground(back); allContain.add(itemTable).right().top().pad(25); itemDetailTable = new Table(); itemDetailTable.setFillParent(true).top().left(); itemScrollPane = new ScrollPane(itemDetailTable, Skin.createDefaultSkin()); itemTable.addElement(itemScrollPane).setPosition(30, 30); itemScrollPane.setSize(500, 540); ButtonGroup buttonGroup = new ButtonGroup(); int counts = 0; var itemlist = player.items.Keys.Where(m => m.types == ItemComponent.ItemTypes.Equitment).ToList(); foreach (var item in itemlist) { var imageUp = new SubtextureDrawable(item.itemIcon); var imageDown = new SubtextureDrawable(item.itemIcon); imageDown.tintColor = Color.DarkGray; var imageChecked = new SubtextureDrawable(item.itemIcon); imageChecked.tintColor = Color.DarkKhaki; var button = new ItemIconButton(imageUp, imageDown, imageChecked); button.setBackground(new SubtextureDrawable(buttonFrame)); button.item = item; button.OnMouseEntry += Button_OnMouseEntry; button.OnMouseExit += Button_OnMouseExit; button.onClicked += Button_onClicked; buttonGroup.add(button); counts++; itemDetailTable.add(button).minSize(64); if (counts > rowcount) { counts = 0; itemDetailTable.row(); } } allContain.addElement(new Label("摁Q:关闭")).setPosition(1200, 710); }
public ShopkeeperSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Neutral.shopkeeper); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 14, 14); this.Idle = new SpriteAnimation(frames, 1, 1, 1, 1, 1, 0, 0, 0, 0); this.Die = new SpriteAnimation(frames, 0); this.Run = new SpriteAnimation(frames, 0); this.Attack = new SpriteAnimation(frames, 0); }
public ElementalSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.elemental); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 12, 14); this.Idle = new SpriteAnimation(frames, 0, 1, 2); this.Run = new SpriteAnimation(frames, 0, 1, 3); this.Attack = new SpriteAnimation(frames, 4, 5, 6); this.Die = new SpriteAnimation(frames, 7, 8, 9, 10, 11, 12, 13, 12); }
public BanditSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.thief); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 12, 13); this.Idle = new SpriteAnimation(frames, 21, 21, 21, 22, 21, 21, 21, 21, 2); this.Run = new SpriteAnimation(frames, 21, 21, 23, 24, 24, 25); this.Attack = new SpriteAnimation(frames, 31, 32, 33); this.Die = new SpriteAnimation(frames, 25, 27, 28, 29, 30); }
public GolemSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.golem); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 16, 16); this.Idle = new SpriteAnimation(frames, 0, 1); this.Run = new SpriteAnimation(frames, 2, 3, 4, 5); this.Attack = new SpriteAnimation(frames, 6, 7, 8); this.Die = new SpriteAnimation(frames, 9, 10, 11, 12, 13); }
public ShieldedSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.brute); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 12, 16); this.Idle = new SpriteAnimation(frames, 21, 21, 21, 22, 21, 21, 22, 22); this.Run = new SpriteAnimation(frames, 25, 26, 27, 28); this.Attack = new SpriteAnimation(frames, 23, 24); this.Die = new SpriteAnimation(frames, 29, 30, 31); }
public GooSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.goo); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 20, 14); this.Idle = new SpriteAnimation(frames, 0, 1); this.Run = new SpriteAnimation(frames, 0, 1); this.Attack = new SpriteAnimation(frames, 5, 0, 6); this.Die = new SpriteAnimation(frames, 2, 3, 4); }
public BlacksmithSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Neutral.blacksmith); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 13, 16); this.Idle = new SpriteAnimation(frames, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3); this.Run = new SpriteAnimation(frames, 0); this.Attack = new SpriteAnimation(frames, 0); this.Die = new SpriteAnimation(frames, 0); }
public BurningFistSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.burning_fist); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 24, 17); this.Idle = new SpriteAnimation(frames, 0, 0, 1); this.Run = new SpriteAnimation(frames, 0, 1); this.Attack = new SpriteAnimation(frames, 0, 5, 6); this.Die = new SpriteAnimation(frames, 0, 2, 3, 4); }
public ThiefSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.thief); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 12, 13); this.Idle = new SpriteAnimation(frames, 0, 0, 0, 1, 0, 0, 0, 0, 1); this.Run = new SpriteAnimation(frames, 0, 0, 2, 3, 3, 4); this.Die = new SpriteAnimation(frames, 5, 6, 7, 8, 9); this.Attack = new SpriteAnimation(frames, 10, 11, 12, 0); }
public DM300Sprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.dm300); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 22, 20); this.Idle = new SpriteAnimation(frames, 0, 1); this.Run = new SpriteAnimation(frames, 2, 3); this.Attack = new SpriteAnimation(frames, 4, 5, 6); this.Die = new SpriteAnimation(frames, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 8); }
public AcidicSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.scorpio); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 18, 17); this.Idle = new SpriteAnimation(frames, 14, 14, 14, 14, 14, 14, 14, 14, 15, 16, 15, 16, 15, 16); this.Run = new SpriteAnimation(frames, 19, 20); this.Attack = new SpriteAnimation(frames, 14, 17, 18); this.Die = new SpriteAnimation(frames, 14, 21, 22, 23, 24); }
public MonkSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.monk); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 15, 14); this.Idle = new SpriteAnimation(frames, 1, 0, 1, 2); this.Run = new SpriteAnimation(frames, 11, 12, 13, 14, 15, 16); this.Attack = new SpriteAnimation(frames, 3, 4, 3, 4, 5, 6, 5); this.Die = new SpriteAnimation(frames, 1, 7, 8, 8, 9, 10); }
public YogSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.yog); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 20, 19); this.Idle = new SpriteAnimation(frames, 0, 1, 2, 2, 1, 0, 3, 4, 4, 3, 0, 5, 6, 6, 5); this.Run = new SpriteAnimation(frames, 0); this.Attack = new SpriteAnimation(frames, 0); this.Die = new SpriteAnimation(frames, 0, 7, 8, 9); }
public GnollSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.gnoll); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 12, 15); this.Idle = new SpriteAnimation(frames, 0, 0, 0, 1, 0, 0, 1, 1); this.Run = new SpriteAnimation(frames, 4, 5, 6, 7); this.Attack = new SpriteAnimation(frames, 2, 3, 0); this.Die = new SpriteAnimation(frames, 8, 9, 10); }
public SkeletonSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.skeleton); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 12, 15); this.Idle = new SpriteAnimation(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3); this.Run = new SpriteAnimation(frames, 4, 5, 6, 7, 8, 9); this.Attack = new SpriteAnimation(frames, 14, 15, 16); this.Die = new SpriteAnimation(frames, 10, 11, 12, 13); }
public CrabSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.crab); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 16, 16); this.Idle = new SpriteAnimation(frames, 0, 1, 0, 2); this.Run = new SpriteAnimation(frames, 3, 4, 5, 6); this.Attack = new SpriteAnimation(frames, 7, 8, 9); this.Die = new SpriteAnimation(frames, 10, 11, 12, 13); }
public WraithSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.wraith); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 14, 15); this.Idle = new SpriteAnimation(frames, 0, 1); this.Run = new SpriteAnimation(frames, 0, 1); this.Attack = new SpriteAnimation(frames, 0, 2, 3); this.Die = new SpriteAnimation(frames, 0, 4, 5, 6, 7); }
public AlbinoSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.rat); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 16, 15); this.Idle = new SpriteAnimation(frames, 16, 16, 16, 17); this.Run = new SpriteAnimation(frames, 22, 23, 24, 25, 26); this.Attack = new SpriteAnimation(frames, 18, 19, 20, 21); this.Die = new SpriteAnimation(frames, 27, 28, 29, 30); }
public WarlockSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.warlock); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 12, 15); this.Idle = new SpriteAnimation(frames, 0, 0, 0, 1, 0, 0, 1, 1); this.Run = new SpriteAnimation(frames, 0, 2, 3, 4); this.Attack = new SpriteAnimation(frames, 0, 5, 6); this.Die = new SpriteAnimation(frames, 0, 7, 8, 8, 9, 10); }
public EyeSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.eye); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 16, 18); this.Idle = new SpriteAnimation(frames, 0, 1, 2); this.Run = new SpriteAnimation(frames, 5, 6); this.Attack = new SpriteAnimation(frames, 4, 3); this.Die = new SpriteAnimation(frames, 7, 8, 9); }
public TenguSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.tengu); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 14, 16); this.Idle = new SpriteAnimation(frames, 0, 0, 0, 1); this.Run = new SpriteAnimation(frames, 2, 3, 4, 5, 0); this.Attack = new SpriteAnimation(frames, 6, 7, 7, 0); this.Die = new SpriteAnimation(frames, 8, 9, 10, 10, 10, 10, 10, 10); }
public ScorpioSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.scorpio); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 18, 17); this.Idle = new SpriteAnimation(frames, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2, 1, 2); this.Run = new SpriteAnimation(frames, 5, 5, 6, 6); this.Attack = new SpriteAnimation(frames, 0, 3, 4); this.Die = new SpriteAnimation(frames, 0, 7, 8, 9, 10); }
public RatKingSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.ratking); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 16, 16); this.Idle = new SpriteAnimation(frames, 0, 0, 0, 1); this.Run = new SpriteAnimation(frames, 2, 3, 4, 5, 6); this.Attack = new SpriteAnimation(frames, 0); this.Die = new SpriteAnimation(frames, 0); }
public PiranhaSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.piranha); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 12, 16); this.Idle = new SpriteAnimation(frames, 0, 1, 2, 1); this.Run = new SpriteAnimation(frames, 0, 1, 2, 1); this.Attack = new SpriteAnimation(frames, 3, 4, 5, 6, 7, 8, 9, 10, 11); this.Die = new SpriteAnimation(frames, 12, 13, 14); }
public SeniorSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.monk); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 15, 14); this.Idle = new SpriteAnimation(frames, 18, 17, 18, 19); this.Run = new SpriteAnimation(frames, 28, 29, 30, 31, 32, 33); this.Attack = new SpriteAnimation(frames, 20, 21, 20, 21, 22, 23, 22); this.Die = new SpriteAnimation(frames, 18, 24, 25, 25, 26, 27); }
public SuccubusSprite(ContentManager content) { var texture = content.Load <Texture2D>(ContentPaths.Assets.Enemy.succubus); var frames = SubtextureDrawable.SubtexturesFromAtlas(texture, 12, 15); this.Idle = new SpriteAnimation(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 1); this.Run = new SpriteAnimation(frames, 3, 4, 5, 6, 7, 8); this.Attack = new SpriteAnimation(frames, 9, 10, 11); this.Die = new SpriteAnimation(frames, 12); }