textdraw fade in screencenter
Okay so I tried making a script that would fade in a text only once if you entered the specified area and after a short while it would automatically fade out without fading in again unless you enter the specified field again, but I guess its too much for me >_<
Could someone help me? I'm really bad with timeout stuff x.x HTML Code:
//#CLIENTSIDE |
Off the top of my head:
You didn't do anything to "fade" it in and "fade" it out as you suggested. The way to do that would be: >Create the text onCreated, set its alpha to 0 default. Assign it to "this.img" >Inside a timeout loop: >>If the player is inside, increase its alpha gradually to 1. This can be done as follows: PHP Code:
PHP Code:
Additionally: I've never created text using that method, so I can't speak to its effectiveness. Is there any reason you skipped the more obvious showText() function? showText(index, x, y, font, style, text); (??? - may have mixed up the last 3 arg's order) Can still do something like: PHP Code:
|
I personally don't think you can use alpha on text. If you convert the text to an image, you could do this. If it works with text, great. I'm sure it won't though...
HTML Code:
//#CLIENTSIDE |
Quote:
i dont want the alpha to be 1 constantly while in the area, it has to just trigger once and fade out until the entire area is touched again basically the above method works with this.chat but i havent figured out a way to do it with findimg in combination with alpha |
|
Quote:
|
changeimgcolors(); seems to be able to affect its transparency, but i still dont get how to make it occur only once like in the pic :<
|
Quote:
Enter a city on UN for the first time and you'll see a message the top, "Welcome to <Town>!" - it fades in and fades out. |
im guessing its just onPlayerEnters though :S
im trying to get it to be more specified for a defined x/y area, hence playerxy in xy |
Quote:
You want it to fade in when they enter the space and then fade out on its own, and then not re-fade in until they've EXITED the space and subsequently RE-ENTERED the space. Is that what you're saying? In that case, you simply set a flag when they enter and unset it when they exit. If the flag is false, make it show the text. If it's true, don't show the text. You'd still create the text under onCreated and initialize it with an alpha of 0. Then you'd simple do: PHP Code:
EDIT: And if you only want it to happen once EVER then simply don't unset the flag (as I did via the line "this.showed = false;" inside checkArea()). In that scenario you probably don't want the text fading prematurely, even if they walk away from the area, and so you'd do my suggestion in the last paragraph (vis-a-vis removing onPause and changing it to scheduleEvent(3, "fadeOut", nil); ) |
Gonna try it
is this the correct negation of player xy in xy? HTML Code:
if (player.x !in |this.x-10,this.x+10| && player.y !in |this.y-5,this.y+5|) { |
Quote:
PHP Code:
|
Quote:
&& = and player.x != player.y 8-D Ok now I tried this, but it isnt fading in nor fading out, just permanently onscreen PHP Code:
|
Here ya go
HTML Code:
//#CLIENTSIDE |
Quote:
|
All times are GMT +2. The time now is 11:07 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.