|
Post by rayman on Dec 18, 2017 5:21:11 GMT -8
hi @all,
i am looking for an easy way to draw a round gradient in the middle of my screen
does someone already have an idea or solution ?
|
|
|
Post by jamesbowman on Dec 21, 2017 12:13:15 GMT -8
Well, you can use a bitmap with a gradient image like this, p.153 of the book: I have some notes on doing it using a 1D bitmap and two passes. Will write the method up on excamera.com.
|
|
|
Post by rayman on Dec 21, 2017 12:24:16 GMT -8
i am looking for something without images
|
|
|
Post by jamesbowman on Dec 21, 2017 13:05:34 GMT -8
You can do it with 20 transparent circles. Might look OK!
The 1D bitmap method uses 256 bytes of main memory.
|
|
|
Post by rayman on Dec 21, 2017 14:23:14 GMT -8
ok, i'm test it have you an 1d bitmap example ?
|
|
|
Post by jamesbowman on Dec 27, 2017 12:42:38 GMT -8
OK, circular gradients coded and looking quite nice: circular(0, 0, GD.w, GD.h, 0x772b55, 0xef8619); GD.cmd_text(GD.w / 2, GD.h / 2, 31, OPT_CENTER, "Hello world"); GD.swap();
at: excamera.com/sphinx/article-circular.html
|
|
|
Post by rayman on Jan 2, 2018 12:33:28 GMT -8
very very nice ... thx for your fast work
|
|
jc07
Junior Member
Posts: 19
|
Post by jc07 on Jan 15, 2020 6:20:03 GMT -8
I went through the Circular gradients document you set up. When I went to try to upload it the compiler said that circular was not declared in scope. I tried a few different versions of the gameduino library but it still didn't work. What do I need to do to use that circular gradient feature? I have posted my code for reference.
#include <SPI.h>
#include <GD23_T4.h>
void setup()
{
Serial.begin(9600); // JCB
GD.begin(0);
}
void loop()
{
GD.Clear();
circular(0, 0, GD.w, GD.h, 0x772b55, 0xef8619);
GD.cmd_text(GD.w / 2, GD.h / 2, 31, OPT_CENTER, "Hello world");
GD.swap();
}
|
|
|
Post by jamesbowman on Jan 15, 2020 6:42:04 GMT -8
|
|