*Edited* found out how to
but i still need to know how to add a custom zoom
but i still need to know how to add a custom zoom
Last edited by a moderator:
[KU]DeathOmen said:been tryin cant seem to find anything :-\ o well ill keep tryin
simulated event RenderOverlays( Canvas Canvas )
{
local float tileScaleX;
local float tileScaleY;
local float bX;
local float bY;
local float fX;
local float fY;
local float ChargeBar;
local float tX;
local float tY;
local float barOrgX;
local float barOrgY;
local float barSizeX;
local float barSizeY;
if ( PlayerController(Instigator.Controller) == None )
{
Super.RenderOverlays(Canvas);
zoomed=false;
return;
}
if ( LastFOV > PlayerController(Instigator.Controller).DesiredFOV )
{
PlaySound(Sound'WeaponSounds.LightningGun.LightningZoomIn', SLOT_Misc,,,,,false);
}
else if ( LastFOV < PlayerController(Instigator.Controller).DesiredFOV )
{
PlaySound(Sound'WeaponSounds.LightningGun.LightningZoomOut', SLOT_Misc,,,,,false);
}
LastFOV = PlayerController(Instigator.Controller).DesiredFOV;
if ( PlayerController(Instigator.Controller).DesiredFOV == PlayerController(Instigator.Controller).DefaultFOV )
{
Super.RenderOverlays(Canvas);
zoomed=false;
}
else
{
if ( FireMode[0].NextFireTime <= Level.TimeSeconds )
{
ChargeBar = 1.0;
}
else
{
ChargeBar = 1.0 - ((FireMode[0].NextFireTime-Level.TimeSeconds) / FireMode[0].FireRate);
}
tileScaleX = Canvas.SizeX / 640.0f;
tileScaleY = Canvas.SizeY / 480.0f;
bX = borderX * tileScaleX;
bY = borderY * tileScaleY;
fX = 2*focusX * tileScaleX;
fY = 2*focusY * tileScaleX;
tX = testX * tileScaleX;
tY = testY * tileScaleX;
barOrgX = RechargeOrigin.X * tileScaleX;
barOrgY = RechargeOrigin.Y * tileScaleY;
barSizeX = RechargeSize.X * tileScaleX;
barSizeY = RechargeSize.Y * tileScaleY;
SetZoomBlendColor(Canvas);
Canvas.Style = 255;
Canvas.SetPos(0,0);
Canvas.DrawTile( Material'ZoomFB', Canvas.SizeX, Canvas.SizeY, 128, 128, 256, 256 ); // !! hardcoded size
Canvas.DrawColor = FocusColor;
Canvas.DrawColor.A = 255; // 255 was the original -asp. WTF??!?!?!
Canvas.Style = ERenderStyle.STY_Alpha;
Canvas.SetPos((Canvas.SizeX*0.5)-fX,(Canvas.SizeY*0.5)-fY);
Canvas.DrawTile( Texture'SniperFocus', fX*2.0, fY*2.0, 0.0, 0.0, Texture'SniperFocus'.USize, Texture'SniperFocus'.VSize );
fX = innerArrowsX * tileScaleX;
fY = innerArrowsY * tileScaleY;
Canvas.DrawColor = ArrowColor;
Canvas.SetPos((Canvas.SizeX*0.5)-fX,(Canvas.SizeY*0.5)-fY);
Canvas.DrawTile( Texture'SniperArrows', fX*2.0, fY*2.0, 0.0, 0.0, Texture'SniperArrows'.USize, Texture'SniperArrows'.VSize );
// Draw the Charging meter -AsP
Canvas.DrawColor = ChargeColor;
Canvas.DrawColor.A = 255;
if(ChargeBar <1)
Canvas.DrawColor.R = 255*ChargeBar;
else
{
Canvas.DrawColor.R = 0;
Canvas.DrawColor.B = 0;
}
if(ChargeBar == 1)
Canvas.DrawColor.G = 255;
else
Canvas.DrawColor.G = 0;
Canvas.Style = ERenderStyle.STY_Alpha;
Canvas.SetPos( barOrgX, barOrgY );
Canvas.DrawTile(Texture'Engine.WhiteTexture',barSizeX,barSizeY*ChargeBar, 0.0, 0.0,Texture'Engine.WhiteTexture'.USize,Texture'Engine.WhiteTexture'.VSize*ChargeBar);
zoomed = true;
}
}