TomaszFurca Posted July 20, 2017 Share Posted July 20, 2017 Hi, I working on GUI in game and i have problem with many panels. What i want to do? 1. set panelItems container in main panel named in my PG as container. Now i must add it on guiTexture to correct display. 2. set iconsImages in my panelItems with wrapping images in panel, now items increase height of panelItems. 3. Is it possible to correct resize panel items to imageContainer (when first point has been resolved). At this moment, when i resize window i lost correct position and size of panelItems, because image in imageContainer is stretched. 4. Should I make fixed resolution in my game, and then for every available resolution set correct values of position? https://www.babylonjs-playground.com/#59N785#1 Thanks for help Tomasz Furca Quote Link to comment Share on other sites More sharing options...
max123 Posted July 20, 2017 Share Posted July 20, 2017 I find it MUCH easier to use standard issue html elements for gui. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 20, 2017 Share Posted July 20, 2017 Hello!, do you mind isolating every question with a PG? So it is simpler to answer / help / fix bugs Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted July 21, 2017 Author Share Posted July 21, 2017 Okey :). First point line 63 has been changed, because i want manage all childrens of main container calling for example texture.removeFromControl(cotainer). https://www.babylonjs-playground.com/#59N785#2 Second point, panelItems (stackPanel) have width 0.33 on fullscreen texture with non vertical positions. I added three images with 0.2 width to this panel. Then this panel has been expanded, but i want keep width of panel and add image wrapping to panelItems. https://www.babylonjs-playground.com/#59N785#1. Remove one item from panel and check what happen: https://www.babylonjs-playground.com/#59N785#3. Third point maybe resolved when we fix realize first. Fourth point is theory question :). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 21, 2017 Share Posted July 21, 2017 Sorry but I do not understand what you want for #1. Do you want to remove all children of a given container? For #2, I would suggest not using a stackpanel but a regular rectangle. This way you can control the width Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted July 23, 2017 Author Share Posted July 23, 2017 Rectangle is not expanded so ok - https://www.babylonjs-playground.com/#59N785#4. Is possible to auto set positions of childrens of rectangle panel (for example set x% from left and x% from top)? I can set it mannualy, but after resize windows always i must change position values (left, top). How about set correct position of rectangle panel on inventory background? Do you have any tip, how do that correct? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 24, 2017 Share Posted July 24, 2017 you can define every property either with percent or pixel so you can define child position with child.left = "10%" Quote Link to comment Share on other sites More sharing options...
TomaszFurca Posted July 25, 2017 Author Share Posted July 25, 2017 It works! Thanks a lot for help. https://www.babylonjs-playground.com/#59N785#9 Additionaly with window resize event i change positions to correct GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.