Jump to content

Jazz

Members
  • Posts

    265
  • Joined

  • Last visited

Posts posted by Jazz

  1. I used something like this in Cuber. Hopefully it will help smile.png Really wish the forum wouldn't mess up the code.

     

    edit: the site changes window.Titlebar and window.Fullscreen. The w should be uppercase. :/

     

    Main.lua

    --Gfx modes
    count = System:CountGraphicsModes()
    rez=count-1
    FPSTable = {}
    resolutions = {}
    for i = 0, count-1 do resolutions[i] = System:GetGraphicsMode(i) end
    --scaling
    optimalWidth = 1920
    optimalHeight = 1080
    local windowstyle = window.Titlebar
    windowstyle=windowstyle+window.FullScreen
    window=Window:Create(title,0,0,System:GetProperty("screenwidth","800"),System:GetProperty("screenheight","600"),windowstyle)
    --set to highest available resolution
    window:SetLayout(0,0,resolutions[count-1].x,resolutions[count-1].y)
    --window:HideMouse()
    --Create the graphics context
    context=Context:Create(window,0)
    if context==nil then return end
    --Create a world
    world=World:Create()
    world:SetLightQuality((System:GetProperty("lightquality","1")))
    --Create a camera
    camera = Camera:Create()
    camera:Move(5,13,-2)
    --load fonts
    fontArial12 = Font:Load("Fonts/arial.ttf",12)
    fontArial24 = Font:Load("Fonts/arial.ttf",24)
    fontArial48 = Font:Load("Fonts/arial.ttf",48)
    --screen ratios
    res1 = resolutions[rez].x/optimalWidth
    res2 = resolutions[rez].y/optimalHeight
    while window:KeyDown(Key.Escape)==false do
    --change resolution
    if window:KeyHit(Key.Down) then
    rez=rez-1
    if rez<1 then rez=0 end
    res1 = resolutions[rez].x/optimalWidth
    res2 = resolutions[rez].y/optimalHeight
    window:SetLayout(0,0,resolutions[rez].x,resolutions[rez].y)
    elseif window:KeyHit(Key.Up) then
    rez=rez+1
    if rez>count-1 then rez=count-1 end
    res1 = resolutions[rez].x/optimalWidth
    res2 = resolutions[rez].y/optimalHeight
    window:SetLayout(0,0,resolutions[rez].x,resolutions[rez].y)
    end
    
    --If window has been closed, end the program
    if window:Closed() then break end
    --Update the app timing
    Time:Update()
    
    --Update the world
    world:Update()
    
    --Render the world
    world:Render()
    context:SetBlendMode(Blend.Alpha)
    screenX = window:GetWidth()/2
    screenY = window:GetHeight()/2
    --draw rect around screen
    context:DrawRect(0, 0, resolutions[rez].x, resolutions[rez].y,1)
    --draw gui panel to scale
    context:SetColor(.2,.2,.2,.7)
    context:DrawRect(screenX-150*res1, screenY-160*res2, screenX-670*res1, screenY-360*res2)
    --draw fonts to scale
    context:SetScale(res1, res2)
    context:SetFont(fontArial24)
    context:SetColor(.2,1,.2,.9)
    context:DrawText("up/down-resolution", screenX-140*res1, screenY-150*res2)
    context:SetColor(.2,1,.2,.9)
    context:DrawText(tostring(resolutions[rez].x).." x "..tostring(resolutions[rez].y), screenX-90*res1, screenY-120*res2)
    context:SetFont(fontArial12)
    context:SetColor(.4,.6,.9,.9)
    context:DrawText("Arial 12", screenX-35*res1, screenY-85*res2)
    context:SetFont(fontArial24)
    context:DrawText("Arial 24", screenX-60*res1, screenY-60*res2)
    context:SetFont(fontArial48)
    context:DrawText("Arial 48", screenX-110*res1, screenY-30*res2)
    --reset scale when done
    context:SetScale(1, 1)
    context:SetBlendMode(Blend.Solid)
    --Refresh the screen
    context:Sync(true)
    end
    

    • Upvote 3
  2. It would be nice if the script editor remembered which monitor it's on and the window size. Every time I start LE I have to drag it over and resize it because I spread it across monitor 2 and 3 and that can be quite often when it exits from errors.

     

    Also if it's possible, have the game run on the monitor the LE editor is on, or a command to select the monitor.

    post-12583-0-02477200-1442766229_thumb.png

    • Upvote 1
  3. I get this

     

    error(#277) Symbol "texturerange" usage doesn't match between two stages

    error(#275) Symbol "texturerange" is defined with 2 different types between two stages

    error(#277) Symbol "texturerange" usage doesn't match between two stages

    error(#275) Symbol "texturerange" is defined with 2 different types between two stages

     

    edit:created new project. Terrain is fine. Don't know why it does this. Guess I'll start over.

    post-12583-0-23568300-1442512134.gif

  4. I played with it and came up with this. Set up for the workshop turret with standard materials for the laser. Can now select constant rotate CW and rotate CCW and set turret at any angle. Laser center pivot removed(not needed). Create a child pivot for the muzzle called muzzle. Fun stuff!

     

    edit: Josh' effects from the following post added and tweaked a bit. No default spark material but default tracer works pretty well. Adjusted flare's position so it comes out a bit.

    post-12583-0-78236300-1442218747_thumb.png

    post-12583-0-09176900-1442218781_thumb.png

    laser.lua

    • Upvote 6
  5. Thanks for those commands. After the model's in ragdoll mode the collision hull keeps going to the next waypoint lol. With BoxesMode it's hard to tell as they all move around with the camera. Disabling culling doesn't help. I'll investigate later when I have some more time.

  6. Was playing with Shadmar's day/night cycle. Switching between z-sort and not.

    Z-sort needs to be disabled for the muzzleflash issue. dry.png So the issue is not z-sort, but without it.

    I like pink but lol

     

    edit: blocks are no longer disappearing. Went back to non-beta but the above issue still exists.

    post-12583-0-97351400-1436122999_thumb.jpg

    post-12583-0-35900000-1436123012_thumb.jpg

×
×
  • Create New...