Hello Guest

Author Topic: Some features (texture protocol)  (Read 4190 times)

unfilet

  • Newbie
  • *
  • Posts: 6
    • View Profile
Some features (texture protocol)
« 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);
}
« Last Edit: December 10, 2013, 05:41:03 pm by unfilet »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Some features
« Reply #1 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.

unfilet

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Some features
« Reply #2 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Some features
« Reply #3 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...

unfilet

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Some features
« Reply #4 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.