ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Two questions about custom GUI XML

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  01:27:05  18 July 2013
profilee-mailreply Message URLTo the Top
Senior Resident

On forum: 01/25/2013

Message edited by:
07/18/2013 1:29:04
Messages: 454
I'm building a GUI from scratch for a little project I'm working on and I have a couple questions.
First, I'm playing the game at 1920x1080 but an XML object like this goes way off the side of the screen:

<background x="0" y="0" width="1920" height="1080" stretch="1">

Is the UI scaled to your selected resolution? If so, what are the width/height limits?
Second, when creating the UI from a script, what do the four parameters in self:Init() do? The first two are the position of the top left corner of your UI but I can't figure out what the third and fourth are for.
Thanks for any advice you can provide.
  22:19:31  24 July 2013
profilee-mailreply Message URLTo the Top
Senior Resident

On forum: 06/15/2007
Messages: 4302
The wrapper element for the background object is probably using 1024x768. It may be that "stretch" only works one way, to make a small display fit a larger one, so your interior elements will be bound by the element that holds them. (Or not bound if 1920x1080.)

That would suggest that you can use 1024x768 here as well. It will be stretched to fit your screen.

As for Init(), that might depend on what class you are talking about. I would expect a UI window class to have width and height for the last two parameters. The scaling might be your problem. Don't do it for starters -- let the game engine map the objects onto the display. You don't know what the actual end-user display resolution is, but the game engine is designed to work with all of the supported resolutions from the standard template. It might not work well, but ...

You might try a look at the UI script files for examples of how this stuff is implemented.
Each word should be at least 3 characters long.
Search conditions:    - spaces as AND    - spaces as OR   
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion

All short dates are in Month-Day-Year format.


Copyright © 1995-2021 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.