Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setColor on RadialLight doesn't change color #31

Closed
EOSource opened this issue Nov 8, 2021 · 5 comments
Closed

setColor on RadialLight doesn't change color #31

EOSource opened this issue Nov 8, 2021 · 5 comments

Comments

@EOSource
Copy link

EOSource commented Nov 8, 2021

So have got all my RadialLight's working like normal but when using .setColor say sf::color::red for example, there is no change in the light color at all? but examples shows it works?

This is compiled with static SFML with /MT option enabled.

Also had an exit error where candle gives an access violation when you exit program which i fixed by manually calling the destructor for RadialLight on every single one made.

Compiled using Visual C++ 2019, /MT

@MiguelMJ
Copy link
Owner

MiguelMJ commented Nov 8, 2021

.setbeamcolor is not a Candle function... Do you mean .setColor`?

And could you show a capture of the error you get on exit, please?
Thanks!

@EOSource
Copy link
Author

EOSource commented Nov 8, 2021

image
That is the error i get on exit if i dont call the deconstructor manually on every object before exiting the with either window.close() or WM_QUIT or std::exit(0) then i get that error in image.

And same problem with #radial_light_fix on or off

Also, yes it is actually .setColor my bad

@EOSource EOSource changed the title Beam color on RadialLight doesn't change color setColor on RadialLight doesn't change color Nov 10, 2021
@MiguelMJ
Copy link
Owner

Ok, I see there's now #32 for that last thing.
About the color not changing: There's only a reason I can think of (based on the code you showed on that issue). You are drawing the lights to a LightingArea in fog mode, but not drawing them afterwards to the scene.
When you draw to a fog area, the opacity is eliminated where the light is, but nothing else, there is no color added. If you want a light both to eliminate the fog and produce some color, then you have to draw it twice: one in the fog and one in the scene.
Let me know if that was the problem
Thank you!

@EOSource
Copy link
Author

Hi thank you for responding, and can confirm after doing this:
image

its now working and i get color yay!! you might want to add a huge TIP to your tutorial docs when using .setcolor and fog
image

@MiguelMJ
Copy link
Owner

Thank you for the feedback! ❤️
I remember mentioning it briefly in the fog tutorial, but I'll do it too in the .setColor description too.
Closing this ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants