![]() |
Image alpha, waitfor, and loops
Hello, I wanted to start off by explaining what I am trying to accomplish.
I wanted to make a similar effect to the xbox360/ps3 notification system. For those of you who use "ubuntu" you may notice it too, uses a similar effect called "NotifyOSD". What I am doing here is drawing a polygon, and replacing it with an image. However, I wanted to use GUI's but had several problems. I could not make a semi-transparent black window appear. I was using GuiWindowCtrl, GuiControl, and GuiShowImgCtrl. No sucess, so I turned to polygons. The problem I am having is that I need the polygon (or gui if anyone can help with that) to fade in/out. I am stumped why this code would not work seeing as it looks correct to me at first glance. Maybe anyone else might have an idea what I am doing wrong. PHP Code:
** Edit *** I was unable to figure out how to change the polygons colors to black so i had to use a black image, stretch it and then change alpha. I know there must be an easier way but it just refused to work for me. ** end edit *** Thank you in advanced, scriptless For solution click here. |
Quote:
Edit: Doesn't seem to the the case. |
You mean such as
PHP Code:
PHP Code:
P.S. I am on testbed if anyone is curious. |
Quote:
PHP Code:
Alpha also ranges from 0 to 1, so dividing i by 100 would be giving you a value no greater than 0.01, which is near if not invisible, this loop is also one way only and only occuring when onCreated is called, when it would need to be running over an amount of time. |
The for loop for "j" is to loop through multiple things being drawn on-top of the polygon. I need 1 text, 1 image and the polygon to all fade at the same time. Looping "j" like that lets me set all the alpha on al lthe images to the same so they fade nice and neatly.
As for the i/100. Are you sure? I mean I did it last night, it worked so im confused. PHP Code:
** EDIT sorry did not notice I had "+= .01", however, this does not solve the problem. PHP Code:
And again, no fade in/out effect, just a alpha that sits there unchanged. |
Quote:
PHP Code:
I think you may have been trying to do: PHP Code:
|
Yes, to adjust all alpha at once. And thank you for pointing that flaw out but why does it still not work?
Ahh.. and yes findimg(4002)) {} should have been "j" but i used 4002 for easier testing so i could comment j completly out and see if it worked by itself, nope. I know this is possible why is it being so hard right now? I know im not drunk or on drugs so what I am seeing happening is reality. Might be worth mentioning that when I do player.chat = i; player chat becomes "6" instantly and does not move at all, no sleep() or waitfor() or even schedualedevent() seems to make a difference. Let me try temp.i, maybe? Okay, thank you for your help. Got it working. PHP Code:
|
Change the mode of the images to 1.
|
Quote:
|
Yup. Default images are set to mode 0, which is a light effect. This MAY mean that it won't be properly transparent unless ALL values(red, green, blue) are lowered along with the alpha. Setting it to mode 1 will not only make it properly transparent, but may also fix the problem you're having. It would also explain why you can't use a black polygon, as black for these light effects = transparency mask.
PHP Code:
Also, I found: http://wiki.graal.net/index.php/Crea...iControls_List to have pretty great examples. If you still need help with GUI's though I could post an example. |
Yes, I do need help. I read that profile's can use fillcolor(r,g,b,a); but no clue how to apply that in pratice. I wanted thought, why not GuiControll, use it's own profile, set it to black, and add alpha but that aparently was beyond my comprehension because I failed misarably. Not only that but gui's when closed seem to not reopen for me O_O when I update my script, I think theres a command to show it again tho?
Something else I was looking for was is there a way to use ("-PlayerList") to get information about who just logged in? If not, I guess a simple onActionPlayerOnline() would work but then it has to alert all people. Then my idea was to check if "isBuddy()" and if so, show a notification very much like how the xbox360 and ps3 currently do. I have it set to 2.5 seconds before it fades out might change it to 3 if needed. Will post a video as soon as I figure out just how graal's built-in video works :o Also I swear I tried that red=green=blue=0; before with no luck but im 100% sure it should have worked. Maybe my pc was bugged. Also, I am running Ubuntu 9.10 since windows crashed on me and I had literally no other cds to install from :( |
I believe it's something like:
new guistuff("test") { useownprofile = true; profile.opaque = false; profile.fillcolor = {255,255,255,255/2}; // GUI's use 0-255 scale for colors } test.show(); // will make the gui come back into view. test.hide(); // will hide it |
Quote:
|
Try profile.opaque = false; then
And like the comment says, GUI's use the 0-255 format instead of 0-1. Thus, 255/2 = 50% = .5. |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 10:32 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.