ControlP5 Sprite Transparency Issue
in
Contributed Library Questions
•
2 years ago
I was wondering if anyone had run across the following issue using Controller Sprites in ControlP5.
I load up a png and attach it to the controller, tell it there's one state, "play" in this case, and everything works just fine; only, if the image is a png, the "bounding box" shows. Which looks pretty odd.
A regular image(png,1,1) call shows the transparency on it to be ok.
- import controlP5.*;
- PImage pgb;
- ControlP5 c;
- ControllerSprite sp;
- controlP5.Button b;
- void setup()
- {
- size(400,400);
- smooth();
- frameRate(30);
- pgb = loadImage("PlayGreenButton.png");
- c = new ControlP5(this);
- sp = new ControllerSprite(c , pgb, pgb.width,pgb.height, 1);
- b = c.addButton("play",1,100, 100, pgb.width,pgb.height);
- b.setSprite(sp);
- }
- void play(int v)
- {
- println("playing: " + v);
- }
- void draw()
- {
- background(0);
- // draw the regular PImage out 100 below
- // transparency is ok.
- image(pgb, 100,200);
- }
The png in this case would be, this guy
I know the Sprites are marked as experimental, but everything else (so far) seems to work.
Any ideas?
-M
1