Skip to content

Instantly share code, notes, and snippets.

@ghostandthemachine
Created December 19, 2009 16:35
Show Gist options
  • Save ghostandthemachine/260137 to your computer and use it in GitHub Desktop.
Save ghostandthemachine/260137 to your computer and use it in GitHub Desktop.
private SGNode createSmiley() {
SGShape circle = new SGShape();
circle.setShape(new Ellipse2D.Float(-20f, -20f, 40f, 40f));
circle.setFillPaint(Color.YELLOW);
circle.setMode(SGShape.Mode.STROKE_FILL);
circle.setDrawStroke(new BasicStroke(0.15f));
circle.setDrawPaint(Color.black);
circle.setAntialiasingHint(RenderingHints.VALUE_ANTIALIAS_ON);
SGShape leftEye = createFill(new Ellipse2D.Float(-8.5f, -11f, 5f, 8f));
SGShape leftDimple = createStroke(createArc(4f, P(-14.6f, 5.7f), P(-10.6f, 2.7f)), 0.5f);
SGShape rightEye = createFill(new Ellipse2D.Float(3.5f, -11f, 5f, 8f));
SGShape rightDimple = createStroke(createArc(4f, P(10.6f, 2.7f), P(14.6f, 5.7f)), 0.5f);
SGShape smile1 = createStroke(createArc(13.5f, P(-12f, 5f), P(12, 5f)), 0.75f);
SGShape smile2 = createStroke(createArc(13f, P(-12f, 5f), P(12, 5f)), 0.75f);
SGGroup group = new SGGroup();
group.add(circle);
group.add(leftEye);
group.add(leftDimple);
group.add(rightEye);
group.add(rightDimple);
group.add(smile1);
group.add(smile2);
return group;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment