AggrorJorn Posted February 23, 2010 Share Posted February 23, 2010 I'm trying to create a world that is specifficaly used for the inventory and mission tab. But i'm not getting anything on screen. I'm using the following code in the loop if KeyHit(KEY_M)==1 then if missionWorld == 0 then mworld=CreateWorld() if mworld==nil then Notify("Mission World FAIL.",1) return end DrawRect(GraphicsWidth()/2,GraphicsHeight()/2,50,50) missionWorld = 1 elseif missionWorld == 1 then missionWorld = 0 end end fw:Update() time=AppTime() fw:Render() mworld:Render() --Render(mworld) SetBlend(1) DrawText(missionWorld,0,400) SetBlend(0) Flip(0) The mission world is active because the text in screen changs correctly, but there is nothing drawn. How should I use the render command? Quote Link to comment Share on other sites More sharing options...
Rick Posted February 23, 2010 Share Posted February 23, 2010 I think all your 2D drawing commands need to be right before Flip() AND after the rendering of the world. What you have it seems to draw the rect but then later you render the screen, which I'm guessing is drawing the 3D world over your rect. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 23, 2010 Author Share Posted February 23, 2010 You are right about that. Is it even possible to create 2d images or text inside a created world? I would like to have all the code for creating the image or text inside a different lua file instead of the main loop so I really hope it is. i'm trying to create it in a world so that it is easier to remove. Quote Link to comment Share on other sites More sharing options...
Rick Posted February 23, 2010 Share Posted February 23, 2010 I think it's possible. I think camera in one of the worlds needs to not erase itself so it'll show through. As long as you draw 2D stuff after the render of that world it'll be on top of that world. But drawing worlds on top of worlds overwrites unless certain things are setup. Quote Link to comment Share on other sites More sharing options...
Niosop Posted February 23, 2010 Share Posted February 23, 2010 Don't the 2D commands draw directly to the BackBuffer? I'm not sure if they even look at the world that's active. Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
Rick Posted February 23, 2010 Share Posted February 23, 2010 That's true, unless they draw to the current buffer. Not sure. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 23, 2010 Author Share Posted February 23, 2010 Creating another world while using the flip hook functions results in that the image drawn on screen doesn't go away when you are back in editing mode. But apart from that: how do you even remove an image or text that has bin drawn on screen ? Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted February 23, 2010 Share Posted February 23, 2010 Don't the 2D commands draw directly to the BackBuffer? I'm not sure if they even look at the world that's active. As far as I know it does, which is why you have the draw commands just before Flip() Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Rick Posted February 23, 2010 Share Posted February 23, 2010 I think it draws on the current buffer. Because you can create and set a buffer and use DrawText() on it. The name tag function Lum created in Gamelib does this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.