PDA

View Full Version : Mask Image for TShowImg?


Kirko
07-04-2016, 08:34 PM
Is this possible? I'm trying to make a lantern that everything is completely black except the areas around players. I first tried with an Gui and got it to show exactly how I want it but wasn't able to finish since guis dont have attachtoowner and some other stuff I would like to use.
Would anyone know how to mask an image using images and not Guis?

this is how it looked like using Guis but cant figure out to make it using TShowImg instead.
http://i.imgur.com/5af3GRj.png
For the Gui I just used a small black square image and stretched it then with another image thats just a white circle i placed on top.

Tim_Rocks
07-04-2016, 10:01 PM
I know it's possible. Era uses a an image overlay for maze events and what not. I wish I had examples for ya, but I'm a bit rusty.

Kirko
07-10-2016, 07:06 PM
Good to know it might be possible, thanks!

If I figure it out I'll post for other.

callimuc
07-14-2016, 07:35 AM
I think dusty made something similar to that but using polygons

EDIT: go check this out

51021

Elk
07-17-2016, 06:26 AM
dusty made an improved thing using 1 zoomed polygon only, but i cant find the thread :/

Kirko
07-29-2016, 12:01 AM
This works but not really want I want. My idea was to have a lantern that slowly dims as its used and the light will slowly decrease in size.
Problem with this is I cant resize the light and it delays when player walks.

//#CLIENTSIDE
function onCreated() {
if (isObject(Kirko_Testing)) Kirko_Testing.destroy();
onTimeOut();
}

function onTimeOut() {
temp.x = screenx(player.x - 3, player.y - 3);
temp.y = screeny(player.x - 3, player.y - 3);

new GuiDrawingPanel("Kirko_Testing") {
resize(0, 0, screenwidth, screenheight);
useownprofile = true;
profile.modal = false;

clearall();
drawimagestretched(0, 0, screenwidth, screenheight, "black2.png", 0, 0, 1, 1);

maskimage(temp.x, temp.y, "k_lantern_light2.png", "multiply");

pushtoback();
}
setTimer(0.05);
}



dusty made an improved thing using 1 zoomed polygon only, but i cant find the thread :/
click the little blue arrow in the post callimuc quoted :)

Kirko
08-12-2016, 07:55 PM
Would anyone happen to know how to resize the mask image?
I'm making something else that's going to be re sizable but cant really get it to work because I can't figure a way to resize the mask image :(

xXziroXx
08-13-2016, 01:37 AM
Put it in a GuiStretchCtrl :)

Elk
08-13-2016, 12:58 PM
click the little blue arrow in the post callimuc quoted :)

i already know that one, but the one he recentlyish made is 100x better :) it has transitions like a normal light...and its with a zoomed polygon

Kirko
08-13-2016, 01:34 PM
Put it in a GuiStretchCtrl :)
I love you