Pedro Kayatt Purple problems...Some fixes [Solved with Workaround]
Posts 56
Location Brazil
Added by Pedro Kayatt about 1 year ago

Hey guys!

I have just got the last version on git and saw that some issues were not fixed there as well.

1st:

The label color issue comes from cocos2d-xna/textures/CCTexture2D.cs in the line:

app.spriteBatch.DrawString(font, text, new Vector2(0, 0), Color.YellowGreen, 0.0f, origin, scale, SpriteEffects.None, 0.0f);

2nd:
app.GraphicsDevice.BlendState = BlendState.AlphaBlend in CCSprites draw()

Apart that I got some problems with the CROSS fade, that shows a purple layer instead of a transparent layer ( I am studying the CCLayerColor to try to solve this, but still nothing).
Nevertheless I got some problem with the pop scene also. There is a point that after you pop a scene there is no current scene, and this NULL scene (still need to understande why it doesn't crash) has a PURPLE background, it would be really nice if this is just black... (going thru the CCDirector and CCApplication to try to solve this, nothing yet).

Anyone has any hints?

Thanks,

Co-Founder and CEO @ http://www.nakedmonkey.mobi

Our Games: Harlem Shake [ iOS | Android ] / jump Monkey [ WP7 | Android ]
Our Apps: Series Notifier [ WP7 ]

Pedro Kayatt RE: Purple problems...Some fixes
Posts 56
Location Brazil
Added by Pedro Kayatt about 1 year ago

Ok, none has answered, but I manage to create some workarounds.

For the problem with the CrossFade (CCTransitionCrossFade) I solve it calling a ClearBlack in my mainLoop

CCApplication.sharedApplication().GraphicsDevice.Clear(Color.Black);

For the other one, I was having it when poping the scenes, after a while I got a "null" scene, but the program was still alive. To edit this I have changed the CCDirector and added the function to kill the app if no scene was found after poping one:
public void popScene()
        {
            Debug.Assert(m_pRunningScene != null, "m_pRunningScene cannot be null");

            if (m_pobScenesStack.Count > 0)
            {
                m_pobScenesStack.RemoveAt(m_pobScenesStack.Count - 1);
            }
            int c = m_pobScenesStack.Count;

            if (c == 0)
            {
                CCApplication.sharedApplication().Game.Exit();
                end();
            }
            else
            {
                m_bSendCleanupToScene = true;
                m_pNextScene = m_pobScenesStack[c - 1];
            }
        }

PS: I also have changed the CCTransitionCrossFade to use a Layer instead of a ColorLayer, it is still working fine here.

Co-Founder and CEO @ http://www.nakedmonkey.mobi

Our Games: Harlem Shake [ iOS | Android ] / jump Monkey [ WP7 | Android ]
Our Apps: Series Notifier [ WP7 ]

RongHong Huang RE: Purple problems...Some fixes [Solved with Workaround]
Posts 171
Added by RongHong Huang about 1 year ago

hi, about the first issue, Color.YellowGreen is used as the default color of labelttf in the init function, you could change its color: label.Color = new ccColor3B(255, 0, 0);

Pedro Kayatt RE: Purple problems...Some fixes [Solved with Workaround]
Posts 56
Location Brazil
Added by Pedro Kayatt about 1 year ago

Hi RongHong,

Thanks for your reply, it seems that you are one of few active users here!

I am nos so sure if the label.Color is the "solution", since when you try to change to a color of your will (like red) the color blends with the YellowGreen that was the init color of the label.

The only way to change colors properly is to make that suggested fix, or at least was the only I manage to get.

Thank you,

PS: I manage to create a little system that makes possible to use the back button of wp7 in the proper way to navigate through scenes, if anyone is interested please talk to me :D

Co-Founder and CEO @ http://www.nakedmonkey.mobi

Our Games: Harlem Shake [ iOS | Android ] / jump Monkey [ WP7 | Android ]
Our Apps: Series Notifier [ WP7 ]


(1-3/3)