For j=0 To 19
Pawn.New2(AppPath & "\PSprite.png",6,15,15,6)
Pawn.Data=1
Pawn.Data=bit.ShiftLeft(Pawn.Data, j Mod 3)
Pawn.X = 1
Pawn.Y = i*16+1
Pawn.Velocity = 0
Pawn.Direction = 0
gw.SpriteAdd(Pawn.Value)
Next
Line 4 gives me an error... Object reference not set to an instance...
Pawn object exists properly.
My brain just isn't coping with something in this regard.
You will save a lot more data using a "stock" Pawn and using New4 to share the Bitmap array than you will use up with all those "constants". That loop allocates a minimum of over 81Kbytes of bitmap pixel data not including class structure overheads.
B4X:
Pawn.Data=1
Pawn.Data=bit.ShiftLeft(Pawn.Data, j Mod 3)
Well now, as I see it...
1 you just added new4 to the Sprite Help while I was reading your answer
2 I didn't study the Help carefully enough and probably would have missed it anyway
3 same again, I didn't scroll the Help and didn't realise it was an Object.
I have seem to have difficulty in forgetting the past. There is much subtlety to this B4PPC.
Thank you for all and sorry to have wasted your time.
[Edit] I would be grateful for a pointer to an example using New4 if possible