Example #1
0
  private CanvasImage createMenuImage(MenuEntry me) {
    CanvasImage result = graphics().createImage(200, 50);
    Canvas resultCanvas = result.canvas();

    //	  resultCanvas.setFillGradient(graphics().createLinearGradient(0f, 0f, 200f, 50f,
    // {Color.rgb(0, 0, 0), Color.rgb(100, 0, 0)}, {0, 0, 200, 50}))
    resultCanvas.setFillColor(Color.argb(50, 255, 255, 255));
    resultCanvas.fillRect(0, 0, result.width(), result.height());
    resultCanvas.setFillColor(Color.rgb(0, 0, 0));
    resultCanvas.drawText(me.getLabel(), result.width() / 2, result.height() / 2);

    return result;
  }
 void DebugDraw(Surface surf, Vector2 offsets) {
   surf.setFillColor(Color.rgb(15, 40, 89));
   surf.fillRect(getPosition().X + offsets.X, getPosition().Y + offsets.Y, 10, 10);
 }