HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Problem with Graphical User Interface

09-11-2009, 10:06 AM#1
Flame_Phoenix
Hi guys, as some of you know, I am making a small space ship map.
In this map I will focus on graphics and imports so the user finds a new world. To achieve this objective I decided to make a graphical interface so the user can choose the ship.

I am building the interface using this function:
Collapse JASS:
// CreateImageEx function by PitzerMike
function CreateImageEx takes string S, real SizeX, real SizeY, real PosX, real PosY, real PosZ, boolean Show returns image
  local image i = CreateImage(S, SizeX, SizeY, 0, PosX - (SizeX / 2), PosY - (SizeY / 2), PosZ, 0, 0, 0, 2) // image type indicator
  call SetImageRenderAlways(i, true)
  call ShowImage(i, Show)
  return i
endfunction

However, it only works in some cases. For some reason it has a really strange behaviour when I use imported images to display:

Click image for larger version

Name:	Image12.jpg
Views:	54
Size:	86.2 KB
ID:	45555

Am I doing something wrong? I think I read in a tutorial this primitive was bugged, if that is true, is there another way to display an image in game?
What other choices do I have?
Attached Images
File type: jpgImage12.jpg (86.2 KB)
09-11-2009, 12:15 PM#2
Hans_Maulwurf
Because of the comments I guess you copied this from my pack. Maybe you should also read PitzerMike's Tutorial which I linked to in the Credits for it ;)

Images need to have a 1px transparent border. Else the border pixel will be drown-out. When you look at the ship icon, you can clearly see, how it's stretched out till the end of the square, in which it is placed.
09-11-2009, 12:30 PM#3
Flame_Phoenix
Yes, it is from your code.
Quote:
Images need to have a 1px transparent border.
?? How do I do that? BloodMage icon in the sample doesn't seem to have that... =S

This is kinda pain in the ass, I have to modify all my imported icons, and even re-import some of the ingame icons to make them work.

There must be an easier way...

Is it possible to create object data dynamically ?
09-11-2009, 12:55 PM#4
Hans_Maulwurf
Quote:
Originally Posted by Flame_Phoenix
How do I do that?
-Decrease the imagesize by 2x2
-Select all and copy
-Reset the size
-Select all and delete
-Paste

Quote:
Originally Posted by Flame_Phoenix
BloodMage icon in the sample doesn't seem to have that... =S
The Bloodmage Icon in the sample isn't displayed via images, but a destructable. I use a model with a replaceable texture. Create a tree with that model and set its replacable texture to the icon you wish to display. Even though you have to do some objecteditor work, its imo the most user-friendly option.
09-12-2009, 11:55 AM#5
Flame_Phoenix
I wish I could do a script to auto generate doodads and such so it could be easier to create icons in-game...
09-12-2009, 11:57 AM#6
Earth-Fury
Quote:
Originally Posted by Flame_Phoenix
I wish I could do a script to auto generate doodads and such so it could be easier to create icons in-game...
http://www.wc3c.net/showthread.php?t=106485