I have a class Building. It contains a _bitmap object, referenced to a drawable. I can draw it on an external View, where its canvas calls myBuilding.getBitmap().
Now I want to draw some windows on the building, but I need them to be "tied" to the building, so that translating the x and y of myBuilding, the windows move together.
Is there a way to attach a bitmap (window) on the main bitmap (building) in order to get the resulting building with windows, when I call myBuilding.ge开发者_开发知识库tBitmap() ?
Thank you.
I don't know how you're drawing (Canvas, OpenGL, AndEngine, CoCo, etc...) so it's a little hard to say.
- If nothing else though, can't you just write your own "move" methods with your "building" class, and simply applythe movement delta to each associated array of windows?
精彩评论