Announcement

Collapse
No announcement yet.

Verticle Charge Bar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Thanks

    ego++;

    Leave a comment:


  • replied
    Lol

    Leave a comment:


  • replied
    Bonehed rocks.

    Leave a comment:


  • replied
    Got it!

    Code:
    class myInv extends Inventory;
    
    var travel Amt, MaxAmt;
    Code:
    ctwid = (Inv.Amt) / (Inv.MaxAmt);


    Thanks for help.

    Leave a comment:


  • replied
    Well, i used a bunch of code from RPG so im just gana leave that, i think the Charges are the rong thing to use

    Leave a comment:


  • replied
    Code:
    if (DecalInv == None)
    		FindDecalInv();
    	if (DecalInv == None)
    		return;
    Do me a favor and fix this, lol. Make FindDecalInf() return a bool, true if it found one, false if not, and do this:

    Code:
    if (DecalInv == None && !FindDecalInv())
    	return;
    It just looks better, lol.

    Otherwise, just make sure Inv.Charge is correctly set.

    Leave a comment:


  • replied
    Sry here is the whole function:
    Code:
    function PostRender(Canvas Canvas)
    {
        local float CScale,CX,ScaledX,CY,ScaledY,SX,SY,ctwid,XPos,YPos;
    
        if ( ViewportOwner.Actor.Pawn == None || ViewportOwner.Actor.Pawn.Health <= 0
    	     || (ViewportOwner.Actor.myHud != None && ViewportOwner.Actor.myHud.bShowScoreBoard) )
    		return;
    
        if (Inv == None)
            FindInv();
        if (Inv == None)
            return;
    
        SX = Canvas.ClipX / 1024.f;
        SY = Canvas.ClipY / 768.f;
    
        CX = 128;
        CY = 256;
        ScaledX = CX * SX * 0.80;
        ScaledY = CY * SY * 0.80;
        CScale = 1.0;
        XPos = (Canvas.ClipX) - (ScaledX * 0.85 * CScale);
        YPos = Canvas.ClipY * 0.40;
    
        ctwid = Inv.Charge / Inv.MaxCharge;
        Canvas.Style = 5;
        Canvas.SetPos(XPos,YPos-(ScaledY*ctwid));
        Canvas.DrawTile( Charge, ScaledX*CScale, ScaledY*ctwid*CScale, 0, (CY-(CY*ctwid))*CScale, CX, CY*ctwid*CScale );
        Canvas.SetPos( XPos,YPos-ScaledY );
        Canvas.DrawTile( Frame, ScaledX*CScale, ScaledY*CScale, 0, 0, CX, CY );
    }
    Let me check out a few things.

    Leave a comment:


  • replied
    ctwid = Inv.Charge / Inv.MaxCharge;

    Thats probably where your problem lies. You didnt post enough code, we need data types. Make sure ctwid is a FLOAT and not an INT. Also make sure the other variables are floats.

    Leave a comment:


  • replied
    Ok, DB, I almost have it working, just that the charge bar in the frame only shows when its full why?

    Code: (Little modified to work for me)
    Code:
        SX = Canvas.ClipX / 1024.f;
        SY = Canvas.ClipY / 768.f;
    
        CX = 128;
        CY = 256;
        ScaledX = CX * SX * 0.80;
        ScaledY = CY * SY * 0.80;
        CScale = 1.0;
        XPos = (Canvas.ClipX) - (ScaledX * 0.1 * CScale);
        YPos = Canvas.ClipY * 0.65;
    
        ctwid = Inv.Charge / Inv.MaxCharge;
        Canvas.Style = 5;
        Canvas.SetPos(XPos,YPos-(ScaledY*ctwid));
        Canvas.DrawTile( Texture'<TexturePack>.ChargeTex', ScaledX*CScale, ScaledY*ctwid*CScale, 0, (CY-(CY*ctwid))*CScale, CX, CY*ctwid*CScale );
        Canvas.SetPos( XPos,YPos-ScaledY );
        Canvas.DrawTile( Texture'<TexturePack>.FrameTex', ScaledX*CScale, ScaledY*CScale, 0, 0, CX, CY );
    Only Shows:
    ._.
    |::|
    |::|
    |::|
    |::|

    or

    ._.
    |_|
    |_|
    |_|
    |_|

    Leave a comment:


  • replied
    The thing was that the Regular charge bar was drawn using widgets and those are only in HUD im using Interaction

    Leave a comment:


  • replied
    Works just like a horizontal charge bar except the x and y coords are flipped, lol. It isnt hard really, once you know how to draw on the canvas (and find a good place to do so).

    Leave a comment:


  • replied
    Yes i see it, just need to figure out how to impliment it into a interaction or the inventory item, ill just change the texture to mine and check it out, thx for your help

    Leave a comment:


  • replied
    The Lightning Gun has an example of a vertical charge bar. Should be easy enough to copy/paste it. Do ask if that's not clear, though.

    Leave a comment:


  • replied
    That's *exactly* what the jetpack charge bar looks like. It's a texture.

    (well, sorta.. mine goes red->green->yellow [bottom to top], look at the colossians teaser to see if that's the kind of thing you're looking for)

    Leave a comment:


  • replied
    Uhh is it just a color bar or texture? cuz i need a custom texture or somehow make it color going from Red on bottom and Green on top.

    Leave a comment:

Working...
X