Add background image to the frame
Hi!
I need to add an own image to the frame as a background. I have only 1 problem, the image is bigger than frame, example: frame 300x300 image 600x400 I need to put a part of this image BUT I don't want that other part is visible outside the frame... I already set layer to background, it doesn't help. Code:
crMapBackground = myframe:CreateTexture(nil,"BACKGROUND") |
|
Yes! Its a little difficult with 4 coord, but I'll try to understand better :)))
Mmmm what is it? (ULx,ULy,LLx,LLy,URx,URy,LRx,LRy); Number - point coordinates; top left corner of the image is (0, 0); bottom right corner is (1, 1). I don't understand why there are 8 params +_+ tried to cut the right part: /script crMapBackground:SetTexCoord(0,0, 0,0, 0.5,1, 0.5,1) |
Use the simpler form with the 4 numbers (you can think of them as percentage height/width anchored to the top-left)
Code:
0,0---------1,0 first 2 numbers define width, last 2 height. 0,1 = 100% width of original texture. 0,1 = 100% height of original texture. (0,0.75,0,0.75) = 75% width, 75% height anchored topleft. (0.25,1,0.25,1) = 75% width, 75% height anchored bottomright. You get the idea. For an alternative zork's work using scrollframes for cropping is a trove of information as well. http://www.wowinterface.com/forums/s...ad.php?t=45918 |
Perfect!
Thank you very much :) |
Spent another 2 hours trying to convert image to tga... Ohhhh.
Tried IrfanView, gimp, ps. Image size 320x320... Hate graphic :( |
Export to 512x512 PNG and convert with http://www.pngconverter.com/
I believe it auto converts alpha opacity to an alpha mask for TGA. |
Image files in WoW have 2 requirements:
|
The website didn't help me :(
Can't find in gimp where can I change bit format... Found it only in PS6, but changing format can't export it as png/tga :/ Installed some other tools... Ohhh, nothing +_+ |
When you save as a .tga in PS, it asks you if you want 32-bit or 24-bit, no?
|
Quote:
Why did you not ask me ingame? I was online with you whole time :D I have Photoshop so... |
Quote:
I find it impossible to believe that any version of Photoshop released in the last 20 years doesn't allow you to save/export to PNG or TGA formats... |
Hmmm +_+ Ok, thanks :) I'll try it one more time when come back home :) May be I miss something :)))
Upd: oh, not today, tomorrow :) |
Found in Photoshop!
The main problem: when I create new image it ask me 8/16/32 bit? If I chose 16 or 32 there is no option to save as tga. 8 bit -> save tga -> ask me if I want 32! 320x320 doesn't work -> 512 yes! Thank you! :) Result: http://www.phoenixstyle.com/files/up..._BossRooms.jpg |
Quote:
When people are telling you 24 or 32 bit, they're talking 24-32 bits per pixel, from the options dialog that pops up after you click save. the settings you're talking about (under Image -> Mode) give you the choice of 8, 16 and 32 bits per channel. A channel is essentially one of the 3 colors, or the transparency of an image. So, if you're talking about 32 bits per channel, that would end up being 12-16 bytes per pixel - or 3-4 times the size you need. Most graphics that you're going to be dealing with use nothing more than 8bits per channel, and 24-32 bits per pixel, depending on whether or not your image has transparency. |
Quote:
Code:
crMapBackground:SetAllPoints (myframe) Also I thought you had to create the texture with: Code:
crMapBackground = myframe:CreateTexture("Texture","BACKGROUND") |
Quote:
All you're doing when you type "Texture", in the first field of CreateTexture, is naming that Texture...Texture. The XML equivalent would be: [code] <Texture name="Texture"> ... </Texture> [code] |
Wow, don't I feel stupid for having created countless textures named Texture ^^
I must have completely misunderstood whichever tutorial I originally saw that on. Thanks for clarifying! |
Quote:
I think we've all done things that seemed to work when we did them, but then realized how absolutely silly it was down the line. For instance, one of my first addons was using a QR library to generate QR codes for various WoW NPCs/items/chat links. The only problem was, each time a code was generated, my addon created around 1600 new frames, instead of just reusing the existing ones, or (better yet), just reuse 1600 textures in one frame. lol |
All times are GMT -6. The time now is 06:11 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI