PDA

View Full Version : scope probs


»SZO« Nutcutter
9th Nov 2005, 04:32 PM
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:lol:

SuperApe
9th Nov 2005, 06:11 PM
I had success working with HUDOverlay. For mutators that won't rely on a gametype specific HUD, it works pretty well. Some normal HUD functions are missed, but that wasn't too hard to overcome.

To find information on it, I browsed some Discussions on HUD pages at the wiki. Just search the wiki and you find them.

»SZO« Nutcutter
10th Nov 2005, 08:18 AM
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)? I was looking at "drawline" but it doesent sound like it moves with the view, cant find much on it though. I guess Id be happy with some sort of 'plus' in white set on top of the same in black (sort of) at least to start with. Do I need to go into ed and create a modifier there?

The further I go the behinder I get LOL!

-NUT

SuperApe
10th Nov 2005, 10:37 AM
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)?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.

I was looking at "drawline" but it doesent sound like it moves with the view, cant find much on it though."Moves with the view", meaning you want it to track with something across the player's viewport? Look into Canvas.WorldToScreen:vector WorldToScreen (vector WorldLoc)

»SZO« Nutcutter
13th Nov 2005, 06:03 AM
OK got it!

You da man (Ape) Super Ape! Thanks!

-Nut

»SZO« Nutcutter
15th Nov 2005, 05:11 AM
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.

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);


Thanks in advance

-NUT

SuperApe
15th Nov 2005, 11:00 AM
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 advanceIsn'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
15th Nov 2005, 11:56 AM
Well there was more past that, I was just showing the main part-Unless I am completely blind(which has happened on more than one occasion!)

-NUT