Jump to content

setClearColor Camera?


Yue
 Share

Go to solution Solved by GorzenDev,

Recommended Posts

self.entity:SetClearColor(12, 183, 242, 1 )  -- Color white. Error. Color Sky Blue not render.
self.entity:SetClearColor(255, 0, 0, 1 ) -- Ok, Color Red.

I'm trying to set the background color of the camera, but it doesn't work, what am I doing wrong?

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

  • Solution

make sure your entity is actually a camera.

tolua.cast(self.entity,"Camera")

as gamecreator said color in code always use normalized values 0-1
if thats a problem you can always do sometihng like

self.entity:SetClearColor(12 / 255, 183 / 255, 242 / 255, 1.0)
self.entity:SetClearColor(255 / 255, 0.0, 0.0, 1.0)

 

  • Thanks 1
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...