Identifier 'LoadImage' not found

Monkey Forums/Monkey Programming/Identifier 'LoadImage' not found

dooz(Posted 2015) [#1]
I loaded my latest app into 86b, and after having some trouble with mojo2 and fantomX imports (thanks forums, I think I sorted that out). But I'm having a weird issue getting:

Identifier 'LoadImage' not found

I only input mojo2 and fantomX other than my own code imports.

I tried importing importing both mojo and mojo2 and get the other error "Duplicate identifier 'Image' ..."

Any ideas?


therevills(Posted 2015) [#2]
A code sample would be useful :)


ImmutableOctet(SKNG)(Posted 2015) [#3]
Mojo and Mojo 2 aren't the same thing. Or at least, 'mojo.graphics' and 'mojo2.graphics' aren't.

From what I understand, FantomX is not an update, it's a properly ported version of the framework. Following what's said on this page, there's no Mojo 1 compatibility presented. The 'LoadImage' command has been replaced with 'Image.Load' and 'Image.LoadFrames'. This sort of thing is prevalent in Mojo 2, as it provides a different graphics framework ('mojo2.graphics' vs. 'mojo.graphics').

With that in mind, however, for the time being, 'mojo2.graphics' is the only framework in Mojo 2. Everything else (Input, sound, etc) is the exact same, even the same modules. Although, you will need to worry about what imports you use in your program, otherwise you'd get name conflicts or build errors (Like what you're getting now).

Now, normally this is where I would tell you to stick to FantomEngine, or port to Mojo 2 (Since FantomX exists), but there's another way to get your project running. I've written a module that provides reasonably close behavior to Mojo 1, while routing everything to Mojo 2. There's very few changes involved for normal Mojo code, but in this case, you'd have to put some work in on your part. The module in question is 'regal.mojoinmojo2', which is a standalone solution. With some work, it could get your application running.

I don't recommend using that module over porting to Mojo 2 yourself, but if you're not looking to do that, it looks like the only way to use FantomX with your existing code. Even then, I'm not sure what is or isn't needed to port to FantomX from FantomEngine, so there's likely extra work on that side.


MikeHart(Posted 2015) [#4]
Hi there,

is this a non-framework project which you try to convert into a fantomX project or a fantomEngine project which you want to upgrade to fantomX?

Anyway, the ftEngine class has the LoadImage command which you could use in this case. It has a similar syntax to the mojo1 command.
There are other ways too, but for this I need to know if you upgrade or convert.


dooz(Posted 2015) [#5]
Sorry for the delay, I usually migrate. I will take a look at the suggestions presented and see how I go. Thank you


dooz(Posted 2015) [#6]
I got it working by using the Image.Load() methods in mojo2. FantomX works perfectly. What an awesome framework, on an awesome platform Monkey-X!

Thanks all