NewsUnrealEdFilesModsFragBULiandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 9th Nov 2005, 04:32 PM   #1
»SZO« Nutcutter
Registered User
 
Join Date: Jul. 15th, 2005
Posts: 24
scope probs

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
»SZO« Nutcutter is offline   Reply With Quote
Old 9th Nov 2005, 06:11 PM   #2
SuperApe
Registered Monkey
 
SuperApe's Avatar
 
Join Date: Mar. 20th, 2004
Location: Inna Jungle
Posts: 333
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.
__________________
- SuperApe


Last edited by SuperApe; 9th Nov 2005 at 06:12 PM.
SuperApe is offline   Reply With Quote
Old 10th Nov 2005, 08:18 AM   #3
»SZO« Nutcutter
Registered User
 
Join Date: Jul. 15th, 2005
Posts: 24
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
»SZO« Nutcutter is offline   Reply With Quote
Old 10th Nov 2005, 10:37 AM   #4
SuperApe
Registered Monkey
 
SuperApe's Avatar
 
Join Date: Mar. 20th, 2004
Location: Inna Jungle
Posts: 333
Quote:
Originally Posted by »SZO« Nutcutter
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.

Quote:
Originally Posted by »SZO« Nutcutter
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)
__________________
- SuperApe

SuperApe is offline   Reply With Quote
Old 13th Nov 2005, 06:03 AM   #5
»SZO« Nutcutter
Registered User
 
Join Date: Jul. 15th, 2005
Posts: 24
OK got it!

You da man (Ape) Super Ape! Thanks!

-Nut
»SZO« Nutcutter is offline   Reply With Quote
Old 15th Nov 2005, 05:11 AM   #6
»SZO« Nutcutter
Registered User
 
Join Date: Jul. 15th, 2005
Posts: 24
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
»SZO« Nutcutter is offline   Reply With Quote
Old 15th Nov 2005, 11:00 AM   #7
SuperApe
Registered Monkey
 
SuperApe's Avatar
 
Join Date: Mar. 20th, 2004
Location: Inna Jungle
Posts: 333
Quote:
Originally Posted by »SZO« Nutcutter
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.
__________________
- SuperApe

SuperApe is offline   Reply With Quote
Old 15th Nov 2005, 11:56 AM   #8
»SZO« Nutcutter
Registered User
 
Join Date: Jul. 15th, 2005
Posts: 24
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
»SZO« Nutcutter is offline   Reply With Quote
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 -5. The time now is 06:57 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer