Where can I find some info on drawing a canvas on top of another? For example why am I having so much trouble making a multicolored scope? Getting lost just doing black and white together
Draw black, draw white over it. They don't necessary have to be separate textures, just different positions or scales. I used Canvas.Style, SetDrawColor, SetPos, DrawTileClipped and it worked fine.»SZO« Nutcutter said:OK I got it working thanx a bunch! Now whats the best way to be able to use black and white together? Do they have to be two separate textures (canvas)?
"Moves with the view", meaning you want it to track with something across the player's viewport? Look into Canvas.WorldToScreen:»SZO« Nutcutter said:I was looking at "drawline" but it doesent sound like it moves with the view, cant find much on it though.
vector WorldToScreen (vector WorldLoc)
else
{
CX = Canvas.ClipX/2;
CY = Canvas.ClipY/2;
ZoomScale = Canvas.ClipX/1024;
if (ZoomString != "")
{
tileScaleX = Canvas.SizeX / 640.0f;
tileScaleY = Canvas.SizeY / 480.0f;
fX = 2*focusX * tileScaleX;
fY = 2*focusY * tileScaleY;
SetZoomBlendColor(Canvas);
Canvas.DrawColor = FocusColor;
Canvas.Style = ERenderStyle.STY_Alpha;
Canvas.SetPos((Canvas.SizeX*0.5)-fX/2,(Canvas.SizeY*0.5)-fY/2);
Canvas.DrawTile( ZoomReticule, fX, fY, 0.0, 0.0, ZoomReticule.USize, ZoomReticule.VSize );
}
else
// default reticule
{
Canvas.SetDrawColor(255,255,255,255);
Canvas.Style = ERenderStyle.STY_Modulated;
// Top Gradient
Canvas.SetPos(200*Canvas.ClipX/401, 3.93*Canvas.ClipY/9);
Canvas.DrawTile(ZoomReticule, Canvas.ClipX/401, Canvas.ClipY/1360*(90-PlayerController(Instigator.Controller).DesiredFOV), 167, 386, 3, 54);
// Left Gradient
Canvas.SetPos(3.94*Canvas.ClipX/9, 200*Canvas.ClipY/401);
Canvas.DrawTile(ZoomReticule, Canvas.ClipX/1360*(90-PlayerController(Instigator.Controller).DesiredFOV), Canvas.ClipY/401, 116, 437, 54, 3);
// Bottom Gradient
Canvas.SetPos(200*Canvas.ClipX/401, 5.07*Canvas.ClipY/9 - Canvas.ClipY/1360*(90-PlayerController(Instigator.Controller).DesiredFOV));
Canvas.DrawTile(ZoomReticule, Canvas.ClipX/401, Canvas.ClipY/1360*(90-PlayerController(Instigator.Controller).DesiredFOV), 167, 437, 3, 54);
// Right Gradient
Canvas.SetPos(5.06*Canvas.ClipX/9 - Canvas.ClipX/1360*(90-PlayerController(Instigator.Controller).DesiredFOV), 200*Canvas.ClipY/401);
Canvas.DrawTile(ZoomReticule, Canvas.ClipX/1360*(90-PlayerController(Instigator.Controller).DesiredFOV), Canvas.ClipY/401, 167, 437, 54, 3);
// Top Gradient
Canvas.SetPos(200*Canvas.ClipX/401, 3.93*Canvas.ClipY/9);
Canvas.DrawTile(ZoomReticule, Canvas.ClipX/401, Canvas.ClipY/1360*(90-PlayerController(Instigator.Controller).DesiredFOV), 167, 386, 3, 54);
// Left Gradient
Canvas.SetPos(3.94*Canvas.ClipX/9, 200*Canvas.ClipY/401);
Canvas.DrawTile(ZoomReticule, Canvas.ClipX/1360*(90-PlayerController(Instigator.Controller).DesiredFOV), Canvas.ClipY/401, 116, 437, 54, 3);
// Bottom Gradient
Canvas.SetPos(200*Canvas.ClipX/401, 5.07*Canvas.ClipY/9 - Canvas.ClipY/1360*(90-PlayerController(Instigator.Controller).DesiredFOV));
Canvas.DrawTile(ZoomReticule, Canvas.ClipX/401, Canvas.ClipY/1360*(90-PlayerController(Instigator.Controller).DesiredFOV), 167, 437, 3, 54);
// Right Gradient
Canvas.SetPos(5.06*Canvas.ClipX/9 - Canvas.ClipX/1360*(90-PlayerController(Instigator.Controller).DesiredFOV), 200*Canvas.ClipY/401);
Canvas.DrawTile(ZoomReticule, Canvas.ClipX/1360*(90-PlayerController(Instigator.Controller).DesiredFOV), Canvas.ClipY/401, 167, 437, 54, 3);
Isn't it just a matter of placing your curly brackets in the right place? (}) I don't see the end curly bracket for your "else" line.»SZO« Nutcutter said:Okay 90% seems to be fine but I have one prob-when a player chooses custom scope opt they can still see the def scope also what gives? IE they see them both at the same time....
Thanks in advance