![]() ![]() Pixmap dialog_sbg = new Pixmap(App.screen_width, App.screen_height, 888) ĭialog_sbg.setColor(new Color(,, , 1f)) NinePatchDrawable npd = new NinePatchDrawable(np) NinePatch np = new NinePatch(sprite, 15, 15, 15, 15) ![]() Sprite sprite = new Sprite(texture_region) ![]() TextureRegion texture_region = App.res_atlas.findRegion("9patch_bg") Using a 9 patch (it can contain the header of the dialog) We have two backgrounds to handle and two possible approaches depending on the design you need This is the Skin that we'll use to design our dialog Notice: this tutorial only covers a dialog that uses the following elements: title, description, spacing, buttons, background and stage background for all other items (checkbox, scrollbar, select) you’re better off using images for each component.įollowing code sequence contains the mandatory styles for the Skin object much needed in the Dialog. However, I wanted to programatically be able to change the dialog properties and style. You would just load the skin with all its assets (9patches, fonts, atlas with sprite) and pass it to the Dialog constructor: Skin skin = new Skin(("uiskin.json")) The test resources can be found here but for this specific task you’ll only need the following ones: LibGDX tutorials describe how to achieve this using graphic resources packed in a sprite together with a skin. This article describes how to programatically create a custom dialog using LibGDX framework.Ĭheck out Lines Galaxy Android game to view the results in action. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |