• Hello and welcome to MSFC. We are a small and close knitted community who specialises in modding the game Star Trek Armada 2 and the Fleet Operations modification, however we have an open field for discussing a number of topics including movies, real life events and everything in-between.

    Being such a close community, we do have some restrictions, including all users required to be registered before being able to post as well as all members requiring to have participated in the community for sometime before being able to download our modding files to name the main ones. This is done for both the protection of our members and to encourage new members to get involved with the community. We also require all new registrations to first be authorised by an Administrator and to also have an active and confirmed email account.

    We have a policy of fairness and a non harassment environment, with the staff quick to act on the rare occasion of when this policy is breached. Feel free to register and join our community.

[Help] GUI Question

kjc733

Wibble
Staff member
Site Manager
Seraphim Build Team
Master Shipwright
Joined
30 Mar 2008
Messages
2,477
Age
39
Had a random thought. Is it possible to include an overlay transparency into the GUI so that you're seeing the map through a tint? Just thought that may be a neat trick if you were replicating, do example, Borg vision, or looking through the visor of a Breen. Anyone tried this before?
 

CABAL

<< ■ II ▶ >>
Staff member
Administrator
Star Navigator
Rogue AI technocrat
Joined
15 Aug 2009
Messages
3,511
Age
33
You might be able to if you did something like expand the background on the selected units box to take up the entire screen, but I'm not sure if it would interfere with selecting units and giving orders.
 

Adm_Z

Gettin' down and GUI!
Joined
23 Nov 2009
Messages
2,745
You can do it in FO but I'm not sure about stock. in my FO SW mod, if you look closely you will notice that I actually made the map background itself transparent. I was quite surprised it actually worked.:sweat:
 

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
It is possible to have such an overlay. The following is a very brief explanation of what you can do to add such as overlay (A1, not sure about A2).

Normally, GUI elements are placed within the interactive area of a panel (area that blocks the background). This area is specified in the gui_***.cfg files. For example, for the info and speed panels respectively:

infoPanelArea = 286 357 205 123
speedPanelArea = 242 318 245 37

Note that the numbers are referenced relative to the top-left corner of the screen.

Interactive elements such as buttons, wireframes, system icons (stuff with tool tips) should be placed within this area. For example:

infoSingleCrewTextArea = 90 19 111 15
speedSingleButtonArea = 9 3 32 32

However, elements that do not need interaction with the mouse cursor (ie, you can still click on things in the background) can be placed outside of the panel area. Negative numbers allow positioning above and to the left of the panel reference point. For example:

infoBackgroundPanel_0 = -154 -9 154 40
speedBackgroundPanel_0 = -19 -5 23 50

Therefore, if you want a transparent overlay to cover the whole screen, you would have to add a GUI element to one of the panels which would cover the whole screen. Please note that the element area is referenced relative to the panel area. That is, if you add an element to the "infoPanelArea" as

infoBackgroundPanel_1 = 0 0 640 480

the top left corner of the new element will be positioned at 286 357, which are the coordinates of the "infoPanelArea". Instead, you would say

infoBackgroundPanel_1 = -286 -357 640 480

This will place the overlay at the top-left corner of the screen, and will make it cover the whole screen area (640x480).

I apologize for the brevity of this explanation... If I made everyone confused, I'll try to expand on this tomorrow :D
 

kjc733

Wibble
Staff member
Site Manager
Seraphim Build Team
Master Shipwright
Joined
30 Mar 2008
Messages
2,477
Age
39
Interesting. I suspected something like this may be possible, but my knowledge of the GUIs are very limited. I'll have to have a play at some point and see what I can come up with.
And if you have any other detail, please feel free to add to your description :thumbsup:
 

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
A bit of extra info :p Some of it may be duplicated in another topic, but I hope it will come in useful. This is for A1 again, but I suspect most of it can be easily applied in A2 as well.

There are two files that you’d be working with most of the time if you're creating or modifying a GUI: “gui_racename.cfg†and “gui_racename.sprâ€, located in the “misc†and “sprites†folders respectively.

Open the cfg file and take a look inside. The cfg file has all the gui components (texture pieces) and their locations on the screen. The location of each component is defined by the first two numbers (x and y position). The size of each component is defined by the two numbers that follow (height and width).

Each menu -- minimap, info panel, special weapon panel, cinematic screen and buttons panel -- is given a back area called the “PanelAreaâ€. For example, the federation special weapons panel (called the speed rail in the cfg) has a back area of:

speedPanelArea = 146 327 247 40

Thus, the special weapons panel is located 146 “pixels†from the left of the screen and 327 “pixels†from the top of the screen. The panel size is 247x40.

NOTE that the speed rail components are now defined relative to the origin of the back area. So, the two texture components that make up the speed rail are

speedBackgroundPanel_0 = 0 0 128 40
speedBackgroundPanel_1 = 128 0 119 40

The cfg file assumes that the screen resolution is 640x480. However, when you’re running the game at any other resolution, the position and size of every component is scaled to fit the screen. The important thing to take from this, and this only becomes apparent in retrospect, is that your gui textures will be drawn at a higher resolution than the resolution of the positioning screen, and that the width and height specified in the cfg is NOT in necessarily in pixels.

The original guis are drawn at 1280x1024. I made Future Tense GUIs at 1024x768. The gui will look best at only one resolution. As such, you should decide what resolution you want to run the game at and draw the guis at that resolution. If you plan on running the mod at 1280x1024, notice that this resolution does not have the same screen aspect ratio as the positioning resolution. In this case, I think that it would be better to draw the guis at 1280x960 to avoid having jagged-looking textures.

If you are adding just one compoent, you don't have to worry about the texture resolution so much, but should still try to make sense of how that works.

Take a look at the sprites file as well. The structure there is similar to any other sprites file (ei, weapons, gui_global etc). Once you have all the textures that you’ll need for your gui, you’re ready to start coding. Use real pixel dimensions in the sprites file and scaled pixel values in the cfg.

Its not too complicated :)
 
Top