Jump to content

render world


AggrorJorn
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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() :)

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...