I seem to have run into a bit of trouble, basically, I started moving code over to CBX, using mojo1, then realised, mojo2 has all the render to texture shenanigans, which I need... Anyhow, when opening up after converting it, it wouldnt open in the iOS simulator, but was fine on the desktop target...
I narrowed it down to canvas.DrawText(), when that was commented out, it opened, and all my placeholder rects were as it should, everything was fine... So, I wrote a crude bitmap font class, just basically this:-
Class CBitmapString
Const FONT_WIDTH:Int = 24
Const FONT_HEIGHT:Int = 24
Field fontImage:Image[]
Method SetupFont()
fontImage = Image.LoadFrames("font24.png",24,24,,0,0)
End Method
Method DrawString(str:String, x:Int, y:Int)
Local strArr[] = str.ToChars()
For Local loop:Int = 0 To str.Length-1
Graphics.DrawImage(fontImage[strArr[loop]],loop * FONT_WIDTH,y)
Next
End Method
End
Which again, was fine on desktop, but crashing the iOS app on startup in the simulator, which pointed me to Images, so, again, I just loaded a bog standard image, tried to draw it... BOOM. I then thought is it something wrong with my code, I'm not doing anything special in there, so opened the mojotest example, and yet... If you run it as is, it doesnt work on the iOS simulator, remove the lines:-
myCanvas.DrawImage(myImage, 320, 240, 0)
myCanvas.DrawText(" ----=== Cerberus X ===----", 320, 344, 0.5, 0.5)
And, the app doesnt crash on startup and runs (Obviously minus the text and image being displayed)
Is this a known issue on iOS at all with the simulator? Anyone experienced this... Ideally I'd like to use the simulator for as much as possible to start, then get an apple dev license to run it on my device eventually, seems a waste when just shifting code over at the mo, if you know what I mean.
Oh, and before I forget, if you have the DrawText line like so...
myCanvas.DrawText("", 320, 344, 0.5, 0.5)
With nowt in the string, it runs, because, well... There's nothing to display is there!
I narrowed it down to canvas.DrawText(), when that was commented out, it opened, and all my placeholder rects were as it should, everything was fine... So, I wrote a crude bitmap font class, just basically this:-
Class CBitmapString
Const FONT_WIDTH:Int = 24
Const FONT_HEIGHT:Int = 24
Field fontImage:Image[]
Method SetupFont()
fontImage = Image.LoadFrames("font24.png",24,24,,0,0)
End Method
Method DrawString(str:String, x:Int, y:Int)
Local strArr[] = str.ToChars()
For Local loop:Int = 0 To str.Length-1
Graphics.DrawImage(fontImage[strArr[loop]],loop * FONT_WIDTH,y)
Next
End Method
End
Which again, was fine on desktop, but crashing the iOS app on startup in the simulator, which pointed me to Images, so, again, I just loaded a bog standard image, tried to draw it... BOOM. I then thought is it something wrong with my code, I'm not doing anything special in there, so opened the mojotest example, and yet... If you run it as is, it doesnt work on the iOS simulator, remove the lines:-
myCanvas.DrawImage(myImage, 320, 240, 0)
myCanvas.DrawText(" ----=== Cerberus X ===----", 320, 344, 0.5, 0.5)
And, the app doesnt crash on startup and runs (Obviously minus the text and image being displayed)
Is this a known issue on iOS at all with the simulator? Anyone experienced this... Ideally I'd like to use the simulator for as much as possible to start, then get an apple dev license to run it on my device eventually, seems a waste when just shifting code over at the mo, if you know what I mean.
Oh, and before I forget, if you have the DrawText line like so...
myCanvas.DrawText("", 320, 344, 0.5, 0.5)
With nowt in the string, it runs, because, well... There's nothing to display is there!
Last edited: