2D Toolkit Forum
2D Toolkit => Support => Topic started by: unfilet on December 10, 2013, 02:25:31 pm
-
I propose to create an interface for objects using Mesh.
public interface IRGBAProtocol
{
void setColor(Color color);
Color getColor();
float getOpacity();
void setOpacity(float opacity);
}
-
Any particular reason?
The mesh class is a unity class. This will have to be implemented on everything in tk2d, and a lot of things (tile map chunks) don't even have any behaviour attached to them.
-
Class tk2dTextMesh and tk2dBaseSprite have common property Color.
I tried write action for fade in/out, but could not make it universal.
-
Well thats the only common thing between them though. text also has a color2, which would be counter intuitive as that would need to change too. It does get a bit messy...
-
The bottom line is that all objects that use texture, support for this protocol. And for textmesh think there will be enough opacity.
You used a cocos2d? Their action system helps to solve a lot of problems. And to somehow use them as needed basis for such protocols.