Jump to content

draw to texture


drarem
 Share

Recommended Posts

How can I draw to a single texture? I want to assemble an image and rotate the whole image, instead of rotating the individual pieces. Like cards on a table, i want to rotate the table with the cards in 2d without including any other images being displayed.

 

I'm trying out the LED library, seems to work ok but I keep hitting the wall of not being able to rotate the group of images.

 

thanks.

Link to comment
Share on other sites

Looks like I need to do this, is this the idea?

 

-- get current buffer, set as old buffer

-- set context to buffer

-- draw stuff on it (image texture, drawrect, etc)

-- blit to destination texture

-- reset buffer to old buffer

Link to comment
Share on other sites

I believe @Drarem is trying to do 2d game rendering in Leadwerks. Leadwerks isn't really designed for 2d. It could do 2d games, but it would require additional programming on the users end to work with 2d concepts.

 

You're not going to have to worry about double buffering or any of that with leadwerks.

 

The best way to do 2d rendering in leadwerks in the way that you're wanting to is to use this Camera::SetProjectionMode

 

Then to render your objects as a sprite. http://www.leadwerks.com/werkspace/page/api-reference/_/sprite/

Link to comment
Share on other sites

Are you saying to create a pivot at run-time and then parent it to the sprites, so just rotating the pivot will rotate all the sprites at once around the pivot? Not trying to do 2d rendering, trying to create graphics at run-time on a 2d billboard or plane. It will be part of the initialization process; it wont be rebuilt with game loop.

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...