Closed GoogleCodeExporter closed 9 years ago
http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene
2d/Actor.html#remove%28%29
Original comment by nathan.s...@gmail.com
on 14 Nov 2012 at 12:00
I added @see #remove() to Group#addActor().
Original comment by nathan.s...@gmail.com
on 14 Nov 2012 at 12:03
I understand that, but shouldn't it be added to Stage#addActor()? The problem
is that it is definitely unclear that you should be removing through the root
Group, especially since Stage has addActor but no removeActor. At least, it is
confusing to me.
Original comment by zairon.e...@gmail.com
on 14 Nov 2012 at 12:13
I should also say that the current method is much cleaner, but it isn't clear
from the docs in Stage that you should be removing actors this way.
Original comment by zairon.e...@gmail.com
on 14 Nov 2012 at 3:30
Agreed, I added @see javadoc to Stage#addActor also.
Stage has a number of convenience methods that just call the same method on the
stage root, just to avoid calling Stage#getRoot(). This was maybe not the
cleanest solution, but it's too late now and I suppose does make using the API
a little less clunky.
We could add Stage#removeActor, but it seems cleaner to have fewer ways of
doing the same task. If people think the @see javadocs to Actor#remove() aren't
enough, I guess I would be ok with adding Stage#removeActor.
Original comment by nathan.s...@gmail.com
on 14 Nov 2012 at 9:27
Nah, I think what you have added is good, unless you want to make a parallelism
argument for having Stage#removeActor(). It looks like you wanted to decouple
the Actor from the Stage for removal, and doing all removals through the Actor
method is good enough for me with the new documentation. As you say it is
cleaner.
The convenience functions for adding through the Stage are necessary to me
though, it makes the code more readable and self-documenting.
Original comment by zairon.e...@gmail.com
on 14 Nov 2012 at 9:34
Original issue reported on code.google.com by
zairon.e...@gmail.com
on 13 Nov 2012 at 11:22