Commit Graph

133 Commits

Author SHA1 Message Date
Michael Bayne c299e830a4 Added enumerateSprites() and removeSprites().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3192 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-30 04:33:08 +00:00
Andrzej Kapolka 97e7d9c823 Spaces after ifs.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3139 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-15 18:20:28 +00:00
Andrzej Kapolka 8ad2aefdf2 Yet more formatting changes. Should be just about compliant with the standard.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3138 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-15 03:09:46 +00:00
Andrzej Kapolka 0b0fcf9d15 I had the orientations backwards.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3137 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-15 00:59:53 +00:00
Andrzej Kapolka 73f44a5ee3 Various changes for style, changes to Card recommended by Ray.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3136 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-15 00:14:23 +00:00
Andrzej Kapolka 90af7c794d A handy orientable sprite.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3134 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-13 02:03:44 +00:00
Michael Bayne 1f8c4578b7 LGPLed the library. Hello world.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3098 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-27 02:12:55 +00:00
Michael Bayne d618d3c771 Eclipse suggested cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2971 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-25 14:50:28 +00:00
Michael Bayne 97a9b91531 Cancel any path on a sprite if it's removed while in the middle of
execution.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2873 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-11-24 21:58:36 +00:00
Ray Greenwell 71109615bc Added setMirage().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2678 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-24 02:25:10 +00:00
Michael Bayne 21210eae62 Documentation clarification.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2541 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-05-04 18:50:23 +00:00
Michael Bayne 99127e4ce0 Revamped sprite observation and added support for being notified if a path
is cancelled.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2504 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-30 00:44:36 +00:00
Michael Bayne 1fc693523d Add constructor that takes bounds. We love the bounds.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2438 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-20 04:52:33 +00:00
Michael Bayne 1d67781bc5 Not to dispatch if we have no observers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2188 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-18 20:45:23 +00:00
Michael Bayne 18c11e90a7 Sprites now dispatch their events immediately rather than queueing them up
to be dispatched after tick() has been called on all sprites.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2183 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-18 03:15:14 +00:00
Michael Bayne 51017ec302 Have to tick() a sprite before painting it since we're using it outside
its normal media panel happy place.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2181 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-18 03:13:32 +00:00
Michael Bayne 0dcb5d67d1 Added Path.wasRemoved(), call it in the Sprite code.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2178 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 22:57:08 +00:00
Michael Bayne dfe837a9d8 Jumped the gun. I suppose we want to allow hot swapping of paths and once
the old path is replaced, it will go away quietly and cleanly.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2177 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 03:50:10 +00:00
Michael Bayne 08cfd0a9f7 Defensive programming rides again.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2176 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-17 03:44:20 +00:00
Michael Bayne 0ae21770d0 Don't draw outside the lines.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2126 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-13 23:53:34 +00:00
Michael Bayne 100aa3ace3 Major media subsystem revamp:
- All images are loaded through the image manager
- Architected to allow the use of prepared or unprepared images (and
  volatile images when the day comes that they support alpha)
- Tunable caches for images and tiles
- Resource manager caches unpacked resources on the filesystem
- Various and sundry other cleanups


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2116 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-13 22:49:47 +00:00
Ray Greenwell 822dabef8c added a way to remove observers
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2073 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-18 23:14:23 +00:00
Walter Korman 3807953a55 Added MediaPanel.clearAnimations(), fixed up comments and removed
unnecessary SpriteManager.clearSprites().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2069 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-15 23:12:37 +00:00
Walter Korman 6552b5bd8b Include the timestamp associated with sprite events in the event.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2020 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-04 02:45:09 +00:00
Michael Bayne 0f0631f318 Do some jiggery poker to make sure that if a path completes as a result of
our call to Path.init() we don't freak out. Also made a note that paths
will be ticked after being init()ed because that's the way it works.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2011 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-02 20:11:24 +00:00
Michael Bayne c8502d212c Have to initialize our path on the first call to tick() now.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1976 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-20 05:33:20 +00:00
Michael Bayne d5dbc514ca Use observer lists.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1906 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 20:52:39 +00:00
Michael Bayne 0608a27c67 Set the sprite's location to exactly what it needs to be in order for its
image to render in the upper left of where we want it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1897 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 03:40:06 +00:00
Michael Bayne 118f6b2363 Provide access to the x and y origin offsets.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1896 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-05 03:38:59 +00:00
Ray Greenwell a0730067ec Pulled out gobs of Sprite/Animation functionality into AbstractMedia.
Pulled out gobs of SpriteManager/AnimationManager functionality into
  AbstractMediaManager.
The big change: sprites can have their render order fine-tuned like
animations.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1787 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-08 21:03:37 +00:00
Michael Bayne cecb5fbef5 We'll be needing the -- not the ++.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1722 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-20 02:19:53 +00:00
Michael Bayne 7e45b58f50 Modified tick() order to prevent unhappy business if a sprite removes
itself in tick().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1721 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-20 02:12:33 +00:00
Michael Bayne 369900bf1a Formatting.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1697 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-17 20:21:19 +00:00
Michael Bayne c08067ac1f Added convenience constructor for simple single frame image sprite.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1693 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-17 19:14:59 +00:00
Michael Bayne 380fa50610 Moved MultiFrameImage and friends from media.sprite into media.util
because they'll be used for both sprites and animations.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1692 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-17 19:11:13 +00:00
Ray Greenwell 5e286e5bab added TIME_SEQUENTIAL animation mode which shows frame 0 first, and
for the full duration.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1687 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-17 02:34:05 +00:00
Michael Bayne 05522ebf66 Allow padding to be specified for sprite icons.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1678 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-09-13 04:50:31 +00:00
Michael Bayne db0c1b59b8 It's not kosher to set a sprite's location until after it is fully
constructed. The reason being that derived classes want to override things
like updateRenderOrigin() which should be called every time the sprite's
location is set, but if we do it in the base class constructor, a derived
class's updateRenderOrigin() will be called before the derived class's
constructor has been called. This is not good. Neither was the existing
code which simply half-assed a location change by updating the sprite's
origin position but not calling updateRenderOrigin(), leaving things
generally confuzzled.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1559 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-08 21:15:35 +00:00
Walter Korman 627ee5a1db Javadoc fixes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1557 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-02 23:15:53 +00:00
Michael Bayne baab1443ef Added method for obtaining access to an immutable list of the sprites
currently registered with the sprite manager.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1543 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-26 02:36:50 +00:00
Michael Bayne a930ae0f0c Added clearSprites() for clearing all sprites in one fell swoop.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1542 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-25 17:31:17 +00:00
Michael Bayne 1f80cf9805 Cleaned up some sprite business: better documented various things, changed
local member names to reflect their actual functionality, flipped the sign
of the origin offset so that it's an offset rather than a negative offset.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1512 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-20 21:42:53 +00:00
Walter Korman b09989f928 Added getLabel().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1509 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-20 09:01:28 +00:00
Michael Bayne 5db81eb137 Don't check for sprite collisions presently. We'll have to revisit this
when we actually want to use the collision support.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1503 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-20 00:54:53 +00:00
Michael Bayne 330767e193 Cleaned up a few things related to render origin. If a derived class wants
the render origin to be other than (_x, _y) it can update (_rxoff, _ryoff)
when it is appropriate to do so, but we don't really need an overridden
method to do that.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1500 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-19 23:30:06 +00:00
Michael Bayne 7253a68c7c Death, taxes and refactoring: seriously revamped the low-level media code
to handle scrolling in a much cleaner and happier way. There's now a
VirtualMediaPanel which operates in virtual coordinates and can be made to
"view" any location in those virtual coordinates. By changing the view,
the view can be scrolled and the view can be made to center on a pathable
(generally a sprite) which will cause it to scroll around as the pathable
moves around in the virtual coordinate space.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1475 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-18 22:25:33 +00:00
Michael Bayne d05d0c8558 Added getPath() to provide access to the path being followed by the
sprite.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1439 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-11 05:56:44 +00:00
Ray Greenwell b9ba9b3d66 bugfix: ImageSprites constructed with their frames were hosed and never
got drawn.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1425 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-06-05 23:38:18 +00:00
Michael Bayne ccbc47a7de Separated path code from sprite code so that we can have other things
follow a path (specifically, I want to allow the media panel to be
"scrolled" along a path).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1409 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-31 03:38:03 +00:00
Michael Bayne 7c4f86e63a pathBeginning() and pathCompleted() need to be public so that we can
create paths outside the media.sprite package.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1407 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-29 23:27:14 +00:00