Page 1 of 1

Sprite brightness

Posted: Tue May 28, 2024 1:28 pm
by Voidy
How can I change the brightness of my 2D sprite? I only found DisplayTransparentSprite for transparency but not for brightness.

Re: Sprite brightness

Posted: Tue May 28, 2024 2:27 pm
by infratec
I think you need to transform your colors to an other model, which allows you to modify the brightness. (maybe HSV)
Then you can convert it back to RGB.

Here in te forum are lready functions to convert rgb to hsv vice versa.
If you have the hsv values, you can increase the v value to get higher brightness and convert it back to rgb.

Re: Sprite brightness

Posted: Wed May 29, 2024 9:31 am
by Voidy
Thanks for your help. I can't find a thread with the example code.

Re: Sprite brightness

Posted: Wed May 29, 2024 9:55 am
by infratec

Re: Sprite brightness

Posted: Thu May 30, 2024 8:39 am
by Voidy
Thank you :)
Unfortunately, PureBasic doesn't have that many 2D sprite functions. Can I import from DirectX11? Is there a example code?

Re: Sprite brightness

Posted: Fri May 31, 2024 2:03 pm
by darius676
https://github.com/microsoft/DirectXTK ... -textures maybe you ll have to do some research yourself? Try, fail, repeat? Like most of developers?

Re: Sprite brightness

Posted: Tue Jun 04, 2024 9:41 am
by Voidy
What kind of answer is that?!
1. I did research, but when I get stuck, I need help.
2. Why does the forum exist if you're not allowed to ask questions?! As if you never asked any questions. -.-

Re: Sprite brightness

Posted: Tue Jun 04, 2024 7:29 pm
by darius676
Maybe my answer sounds rude, but in my opinion, there so many people asking for ready to go solutions, without investigation by their own. I m an old computer guy. When starting programming, coding, I had to search for solutions, not for answers. I m sorry if you feel bad. isn't programming, coding an adventure, where you can fail, go back search resources, try to implement code, try to understand, what's behind the curtain? I had to buy and read books. Now the internet is full of solutions, of ways to get a hint. Why not try it? Why not use Microsoft, to understand how Windows /DirectX API may help? Yes it takes time . Time to progress, time to fail. But getting the solution by yourself can be so satisfying. Make yourself proud. And the results will last forever. In this forum, are so many encouraged people. But just to use them as a code/sniped automat, I feel, this isn't right. And it's not fair, not fair to you. Besides: I m not a rude person, I read this Forum for years, and it helped me, inspired me. I found solutions, ways to solve a task. But in a way, to study the language, the API. And now I m far away from a "good" developer, but I try to get better.
Yes I use this Forum, and yes I aske(d) for help, but never for a final code, just for the way. A good source is RSBASIC with WINAPI Collection. Purebasics Help also is a good source.
https://mark-dowen.itch.io/ If you interested, what I have achieved with nearly plain purebasic code and some hints in the forum, and trial and error. All done in my free time ( which is very short :cry: ) . Overall, maybe it's just my imagination, that people, don't want help, they want the result. This is not reduced to this forum. Hopefully you understand my standing and opinion.

Re: Sprite brightness

Posted: Wed Jun 05, 2024 8:47 am
by Voidy
You're right. There are people who are lazy and ask questions about every little thing instead of using Google first, but I'm not like that.
Thank you for the url.
Have a nice day :)