scope probs

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

»SZO« Nutcutter

New Member
Jul 15, 2005
24
0
0
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

Registered Monkey
Mar 20, 2004
333
0
16
Inna Jungle
wiki.beyondunreal.com
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.
 
Last edited:

»SZO« Nutcutter

New Member
Jul 15, 2005
24
0
0
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

Registered Monkey
Mar 20, 2004
333
0
16
Inna Jungle
wiki.beyondunreal.com
»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)?
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:
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:
Code:
vector WorldToScreen (vector WorldLoc)
 

»SZO« Nutcutter

New Member
Jul 15, 2005
24
0
0
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.

Code:
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

Registered Monkey
Mar 20, 2004
333
0
16
Inna Jungle
wiki.beyondunreal.com
»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
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

New Member
Jul 15, 2005
24
0
0
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