0

I'm coding a mobile application using xamarin forms and I want to use cocosSharp. I would like to add a background from a png image to a ccLayer or a ccScene but I found nothing about that. I hope someone has a solution.

Thanks,

Nicolas

Prashant Cholachagudda
  • 13,012
  • 23
  • 97
  • 162
Nicolas
  • 41
  • 1
  • 3
  • 3
    Question is too general, please specify what exactly your difficulties, you may add code sample that will better describe your problem. – Ori Price Apr 05 '16 at 21:17

2 Answers2

0

You could add the images to a spritesheet and then call it from there. That will give you a better performance too. Please check this tutorial https://developer.xamarin.com/guides/cross-platform/game_development/cocossharp/ccspritesheet/

Libin Joseph
  • 7,070
  • 5
  • 29
  • 52
0

You could simply create a CCSprite and add it to your layer. Just make sure the ZOrder is lower than other objects on the layer.

var back = new CCSprite("mybackground");
AddChild(back);
jonjarn
  • 56
  • 2