2D Toolkit Forum

2D Toolkit => Support => Topic started by: unfilet on December 10, 2013, 02:25:31 pm

Title: Some features (texture protocol)
Post 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);
}
Title: Re: Some features
Post by: unikronsoftware on December 10, 2013, 02:43:09 pm
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.
Title: Re: Some features
Post by: unfilet on December 10, 2013, 02:51:27 pm
Class tk2dTextMesh and tk2dBaseSprite have common property Color.
I tried write action for fade in/out, but could not make it universal.
Title: Re: Some features
Post by: unikronsoftware on December 10, 2013, 05:09:06 pm
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...
Title: Re: Some features
Post by: unfilet on December 10, 2013, 05:31:00 pm
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.