UnrealScript Game Programming Cookbook

(Chris Devlin) #1
Chapter 7

215

// Crosshair image
CrosshairImage=Texture2D'UI_HUD.HUD.UTCrossHairs'
// Crosshair location
CrossHairCoordinates=(U=192,V=64,UL=64,VL=64)

/** Crosshairs - From UTHUDBase */
// Crosshair size
ConfiguredCrosshairScaling=1.0
// Crosshair color
BlackColor=(R=0,G=0,B=0,A=255)
}


  1. Don't forget to add our DrawWeaponCrosshair() function to our DrawHud()
    function!
    /**

    • Draws the HUD
      **/
      function DrawHUD()
      {
      super.DrawHUD();




DrawHealthText();
DrawPawnNameText();
DrawAmmoText();
DrawWeaponCrosshair();
}


  1. Compile the code and view your results!

Free download pdf