Raised This Month: $ Target: $400
 0% 

Solved Change sprite/decal image size


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Yoi
Junior Member
Join Date: Nov 2018
Location: Russia
Old 01-22-2020 , 23:19   Change sprite/decal image size
Reply With Quote #1

Hello, Im trying to spawn an .vtf image that have 1024x1024 resolution, I can't make it 512x512 or lower because text starts being unreadeable.
In first, I tryed to use env_sprite_oriented:
Code:
void spray(float vOrigin[3], float vAng[3], String:spray_model[], String:scale[])
{
	newsprite = CreateEntityByName("env_sprite_oriented");
        DispatchKeyValue(sprite, "spawnflags", "1");
        DispatchKeyValue(sprite, "rendermode", "1");
	DispatchKeyValue(sprite, "model", spray_model);
	DispatchKeyValue(sprite, "rendercolor", "70 70 70 255");
	
         DispatchKeyValue(sprite, "scale", scale);
	
	DispatchSpawn(sprite);
	TeleportEntity(sprite, vOrigin, vAng, NULL_VECTOR);
}
I can change the scale, but I can't make image smaller than 0.3. This is my vmt:
Code:
"Sprite"

{
	"$spriteorientation" "oriented"
	"$spriteorigin" "[ 0.50 0.50 ]"
	"$basetexture" "vgui/logos/1"
	"$selfillum"  "0"
	"$selfillumtint" "[0 0 0]"
	"$color" "{0 0 0}"
	"$color2" "{0 0 0}"
	"$alpha" "0.5"
	"$notint" "1"
}
//I tryed to change $scale but it works just like my scale function in .sp.
I also tryed to make TE decals like this:
Code:
TE_Start("BSP Decal");
TE_WriteVector("m_vecOrigin",vector);
TE_WriteNum("m_nEntity",0);
TE_WriteNum("m_nIndex",PrecacheDecal(sModelpath));
with this .vmt:
Code:
"LightmappedGeneric"
{
	"$basetexture" "vgui/logos/1"
	"$decal" "1"
        "$translucent" "1"
        "$decalscale" "0.10000"
}
And this is just what I need, $decalscale works prefect. but I cant delete it. I mean, I want to try make images listable, I can place new decal on previous, but I think I should delete previous and clear memory...maybe I'm wrong.
So all that Im looking for - is how to make image ingame that I can make small enough. And remove it when I want.

Last edited by Yoi; 01-25-2020 at 10:15.
Yoi is offline
Yoi
Junior Member
Join Date: Nov 2018
Location: Russia
Old 01-25-2020 , 10:14   Re: Change sprite/decal image size
Reply With Quote #2

Solved, I start using World Decal, instead of "BSP Decal". It has decal limit like bulletholes (I dont know if bsp decal has) and it can be cleared with r_cleardecal (sad, that I can't execute it serverside). I also can "clear" Image with placing a new one upside previous.
Yoi is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:15.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode