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 enumEye.LidPosition
-
Field Summary
Fields Modifier and Type Field Description private final Rectangleboundsprivate ColoreyeColorprivate ColoreyeBackgroundprivate Eye.LidPositionlidPositionprivate final Pointcenterprivate final Integerradiusprivate final Pupilpupil
-
Method Summary
Modifier and Type Method Description RectanglegetBounds()final ColorgetEyeColor()final UnitsetEyeColor(Color eyeColor)final ColorgetEyeBackground()final UnitsetEyeBackground(Color eyeBackground)final Eye.LidPositiongetLidPosition()final UnitsetLidPosition(Eye.LidPosition lidPosition)final PointgetCenter()final IntegergetRadius()final PupilgetPupil()final UnitsetPupilPosition(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 UnitfillCircle(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)
-
-
-
-