Jump to content

Jazz

Members
  • Posts

    265
  • Joined

  • Last visited

Posts posted by Jazz

  1. Using non-beta everything was fine until I updated to beta version to resolve a publishing issue. Now when z-sort is enabled my materials don't react to light.

     

    Something changed again. Ideas?

     

    Pics attached. First is from non-beta when it was working fine. Second and third are beta with and without z-sort and the last two without and with z-sort.

    post-12583-0-45585500-1436040345_thumb.jpg

    post-12583-0-67357700-1436040368_thumb.jpg

    post-12583-0-64446500-1436042443_thumb.jpg

    post-12583-0-59035600-1436042464_thumb.jpg

    post-12583-0-89682000-1436042486_thumb.jpg

  2. Earlier beta versions my textures for the gui were fine, now everything is rounded up. For example, images which are 128x192 are now rounded up to 128x256 and are stretched. 118x91 to 128x128, etc. I hope this is just a new bug. Has this affected anyone else?

  3. I needed to do this for zooming the camera in/out on the player.

     

    Script.mouseTemp = Vec3()
    
    
    function Script:GetMouseWheel()
    local context = Context:GetCurrent()
    local window = context:GetWindow()
    local mouseWheelPos = window:GetMousePosition()
    if ( mouseWheelPos.z > self.mouseTemp.z ) then
     self.mouseTemp = mouseWheelPos
     System:Print("Return 1 for Wheel up")
     return 1
    elseif ( mouseWheelPos.z < self.mouseTemp.z ) then
     self.mouseTemp = mouseWheelPos
     System:Print("Return 2 for Wheel down")
     return 2
    end
    self.mouseTemp.z = mouseWheelPos.z
    --if wheel not moved it returns 0
    return 0
    end
    

  4. There is an extra parameter entered which you don't need. smile.png

     

    Change this:

    context:DrawImage(self.HudRightImage,context:GetWidth()-self.HudRightImage:GetWidth(),context:GetHeight()-self.HudRightImage:GetWidth(),context:GetWidth(),context:GetHeight())

     

    to this:

    context:DrawImage(self.HudRightImage, context:GetWidth()-self.HudRightImage:GetWidth(), context:GetHeight()-self.HudRightImage:GetHeight())

     

    Context::DrawImage

     

    Syntax

    • void DrawImage(Texture* texture, int x, int y, int width, int height)
    • void DrawImage(Texture* texture, int x, int y)

  5. Health Bar:

     

     

    function Script:PostRender(context)

     

    --background

    context:SetColor(self.backgroundColorFractioned)

    context:DrawRect(self.offset.x, context:GetHeight() - self.offset.y, self.size.x, self.size.y)

     

    --healthbar

    context:SetColor(self.healthbarColorFractioned)

    local healthFactor = self.player.script.health / self.player.script.maxHealth

    context:DrawRect(self.offset.x,context:GetHeight() - self.offset.y, self.size.x * healthFactor, self.size.y)

     

    --Draw overlay

    if self.overlay ~= nil then

    context:SetBlendMode(Blend.Alpha)

    context:SetColor(1,1,1,1)

    context:DrawImage(self.overlay, 0, context:GetHeight() - self.overlay:GetHeight())

    context:SetBlendMode(Blend.Solid)

    end

    end

     

    Both these scripts are unaltered from Leadwerks (Pistol prefab) and Aggror (Player Health Bar).

     

    Thanks.

     

    Does putting context:SetBlendMode(Blend.Alpha) right at the start of the postrender function help?

×
×
  • Create New...