Hello everyone, sorry my english is not so good because im german.
I will tell you a few options with the Dialog System to make a unique Interface.
Screen Images and Buttons with a specific ID outside, the most people will work with Dialog and Dialog Items.
Dialogs are like a stack of gamecards every new created Dialog is on the Top. You can destroy every Dialog in every position of the stack seperat but new creating dialogs are always on the top. Its not very important when you plan a Dialogsystem without destroy commands but with it you must have the new stack position in the head.
For dont disturbing the stack order you can show/hide Dialogs, the problem is that this command dont refresh the Information. When you change the information in the Dialog (not the position because we have a move order) you must destroy the Dialog and recreate it.
You need a move animation for you Dialog because the move command teleport the dialog? No problem, a simple way is to use timers. Build a Trigger with the event of a loop timer and the action modifiy variable (x and y) and put the two variables in the coordinates for a move command. Every time the timer reached zero your variables are modified and the modified variables are the new move coordinates. A new Move Action in the loop trigger and the Dialog of your choice moves in the speed of your choice over the screen. The same commands you can use for screen images, sizes etc... You can create easy flash like movies.
Starcraft2 have a good textures but the size is often not okay and you only need a piece of the image? Create a Dialog with the image size of your choice (like 152,152 achievmentpic ). Give the Dialog a image ( 912,912 because achievmentpics have 36 chars on a sheet) now you can play with the offset and move the big picture but its only in the Dialog Box (152,152) visible. With resize the image you can shrink or increase the image.
You need a HP Bar like Baldurs Gate (red color in the char portrait)? No problem create a Dialog with the size of the portrait icon (152x152 in my case).
Because i used a achievment pic sheet i cant use a borderline. The border must be a seperate Dialog in my example.
Think on the stack order is the first law.
Now i create a second image with a transparent red texture (a red borderline in my example) to the Portrait Dialog and put the image with the offset outsight at the bottom.
The Y coordinate is a variable (Integer), Dialog coordinates are always Integer, no real numbers.
Create Trigger
event = Unit X HP percent Change
action=
Variable (real)= HP percent Unit X
modify Variable(real) *1.52 (because i have 152pixel but only 100% ;) )
Variable Integer = (integer (variable real)) (transform real to integer)
(sometimes you need a second modifyer with a +/- value because you need a start value or the defference etc. because of your anchor or the texture have a transparent border, the correct values for the modifier are a little tricky and often trial and error)
Now destroy and create command for the portrait Dialog, you dont see flicker but the HP Value work. Test it.
Dont use Dialog Items like Buttons in the destroyed Dialog because the destroying interupt the push animation etc. ... In my example i have a seperat Dialog under the portrait Dialog for the border so its no problem.
I hope the tutorial was not so bad because of my grammar =/
(the normal game ui is needed for the attack command to dmg my own unit =P )
My Portraits are the achievment pics. They are static without animation but its okay for me. Under achievment you find 3 sheets with 6x6 pics. I use a Dialog 152x152 and the original picture size as image for this dialog to make only the pictue of my choice visible.
The blue borders are from ui_battlenet stuff.
Okay I upload my Interface Testmap.
Its 100% Triggereditor with many spontaneous ideas so its not really clean and some solutions can be easier reached (i think).
I use the german Editor so i have no idea that all thinks work with the english version.
The standart game ui is necessary because without i have no attack option in this version, ignore it.
Use the Attack Button and Hurt your comrades!
Hello everyone, sorry my english is not so good because im german. I will tell you a few options with the Dialog System to make a unique Interface. Screen Images and Buttons with a specific ID outside, the most people will work with Dialog and Dialog Items.
Dialogs are like a stack of gamecards every new created Dialog is on the Top. You can destroy every Dialog in every position of the stack seperat but new creating dialogs are always on the top. Its not very important when you plan a Dialogsystem without destroy commands but with it you must have the new stack position in the head.
For dont disturbing the stack order you can show/hide Dialogs, the problem is that this command dont refresh the Information. When you change the information in the Dialog (not the position because we have a move order) you must destroy the Dialog and recreate it.
You need a move animation for you Dialog because the move command teleport the dialog? No problem, a simple way is to use timers. Build a Trigger with the event of a loop timer and the action modifiy variable (x and y) and put the two variables in the coordinates for a move command. Every time the timer reached zero your variables are modified and the modified variables are the new move coordinates. A new Move Action in the loop trigger and the Dialog of your choice moves in the speed of your choice over the screen. The same commands you can use for screen images, sizes etc... You can create easy flash like movies.
Starcraft2 have a good textures but the size is often not okay and you only need a piece of the image? Create a Dialog with the image size of your choice (like 152,152 achievmentpic ). Give the Dialog a image ( 912,912 because achievmentpics have 36 chars on a sheet) now you can play with the offset and move the big picture but its only in the Dialog Box (152,152) visible. With resize the image you can shrink or increase the image.
You need a HP Bar like Baldurs Gate (red color in the char portrait)? No problem create a Dialog with the size of the portrait icon (152x152 in my case). Because i used a achievment pic sheet i cant use a borderline. The border must be a seperate Dialog in my example.
Think on the stack order is the first law.
Now i create a second image with a transparent red texture (a red borderline in my example) to the Portrait Dialog and put the image with the offset outsight at the bottom. The Y coordinate is a variable (Integer), Dialog coordinates are always Integer, no real numbers.
Create Trigger event = Unit X HP percent Change action= Variable (real)= HP percent Unit X modify Variable(real) *1.52 (because i have 152pixel but only 100% ;) ) Variable Integer = (integer (variable real)) (transform real to integer)
(sometimes you need a second modifyer with a +/- value because you need a start value or the defference etc. because of your anchor or the texture have a transparent border, the correct values for the modifier are a little tricky and often trial and error)
Now destroy and create command for the portrait Dialog, you dont see flicker but the HP Value work. Test it. Dont use Dialog Items like Buttons in the destroyed Dialog because the destroying interupt the push animation etc. ... In my example i have a seperat Dialog under the portrait Dialog for the border so its no problem.
I hope the tutorial was not so bad because of my grammar =/
(the normal game ui is needed for the attack command to dmg my own unit =P )
The result is really nice. Any way to have a sample map included?
I'd be particulary interested in where to find the Portrait assets. I suck too much to find them myself.
@s3rius: Go
My Portraits are the achievment pics. They are static without animation but its okay for me. Under achievment you find 3 sheets with 6x6 pics. I use a Dialog 152x152 and the original picture size as image for this dialog to make only the pictue of my choice visible. The blue borders are from ui_battlenet stuff.
Okay I upload my Interface Testmap. Its 100% Triggereditor with many spontaneous ideas so its not really clean and some solutions can be easier reached (i think). I use the german Editor so i have no idea that all thinks work with the english version. The standart game ui is necessary because without i have no attack option in this version, ignore it. Use the Attack Button and Hurt your comrades!