PCL CocosSharpView example

bittersweet69bittersweet69 GBMember ✭✭

Hi, I've been looking around for a cross platform CocosSharp example using CocosSharpView. I thought I'd found one here but this uses native views to instantiate the CCGameView object:-

https://developer.xamarin.com/samples/mobile/BouncingGame/

Also, in this example it's not apparent how the Droid version resolves it's assests (paddle, ball) when creating sprites.

Is there an example of a PCL with CocosSharpView being shared by Android/iOS? I'm particulary interested in Android Assets as I can't seem to find or use these in my app i.e. the following line does not work for me when executed in the PCL project:-

paddleSprite = new CCSprite ("paddle");

I get a sprite with no texture output as a white squre on Android.

Thanks,
Peter.

Answers

  • MrTcMrTc PKMember ✭✭

    after creating the CCSprite you have to add in Child of the scene otherwise it will not show on Screen and turn out the Blank white screen
    CCSprite paddleSprite = new CCSprite ("paddle");
    then add in child
    AddChild(paddleSprite );

    and also set the position of these sprite to look beeter on screen
    paddleSprite.position = VisibleBoundsWorldspace.Center;
    this will make the Paddle sprite on Center of the Screen

    Hope it Helps :)

    Happy Coding

Sign In or Register to comment.