Class Eye
-
- All Implemented Interfaces:
-
crackers.kobots.graphics.animation.Ocular
public final class Eye implements Ocular
Models a cartoonish "eye". Assumes coordinates are in Graphics2D space. The eyes are currently not drawn with outlines, so the eye color itself is initially assumed to be white, with a black background.
TODO add an optional iris (fixed size)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
Eye.LidPosition
-
Field Summary
Fields Modifier and Type Field Description private final Rectangle
bounds
private Color
eyeColor
private Color
eyeBackground
private Eye.LidPosition
lidPosition
private final Point
center
private final Integer
radius
private final Pupil
pupil
-
Method Summary
Modifier and Type Method Description Rectangle
getBounds()
final Color
getEyeColor()
final Unit
setEyeColor(Color eyeColor)
final Color
getEyeBackground()
final Unit
setEyeBackground(Color eyeBackground)
final Eye.LidPosition
getLidPosition()
final Unit
setLidPosition(Eye.LidPosition lidPosition)
final Point
getCenter()
final Integer
getRadius()
final Pupil
getPupil()
final Unit
setPupilPosition(Double xDelta, Double yDelta)
Set the pupil position relative to the eye center. <Error class: unknown class>
clear(Graphics2D graphics)
<Error class: unknown class>
draw(Graphics2D graphics)
final Unit
fillCircle(Graphics2D $self, Integer x, Integer y, Integer radius)
-
-
Method Detail
-
getEyeColor
final Color getEyeColor()
-
setEyeColor
final Unit setEyeColor(Color eyeColor)
-
getEyeBackground
final Color getEyeBackground()
-
setEyeBackground
final Unit setEyeBackground(Color eyeBackground)
-
getLidPosition
final Eye.LidPosition getLidPosition()
-
setLidPosition
final Unit setLidPosition(Eye.LidPosition lidPosition)
-
setPupilPosition
final Unit setPupilPosition(Double xDelta, Double yDelta)
Set the pupil position relative to the eye center. The pupil is constrained to be within the eye and will show at least 80% of the pupil at the outsides of the eye.
TODO this should be handled as a radial difference from the center, not cartesian
- Parameters:
xDelta
- the relative position of the pupil in the x directionyDelta
- the relative position of the pupil in the y direction
-
clear
<Error class: unknown class> clear(Graphics2D graphics)
-
draw
<Error class: unknown class> draw(Graphics2D graphics)
-
fillCircle
final Unit fillCircle(Graphics2D $self, Integer x, Integer y, Integer radius)
-
-
-
-