开发者

Attach a bitmap on another bitmap

开发者 https://www.devze.com 2022-12-24 18:18 出处:网络
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().

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?
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号