Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
20. September 2012

I ran into a small problem today, that took more then a few cycles to puzzle out.

 

Basically I was installing and configuring Moai to work on Mac, and this process had a few steps.

First I had to install the FMOD libraries and configure them in Xcode. 

Then I needed to build each host ( I am working from Git instead of the compiled binaries )

I then configured my preferred Lua/Moai IDE IntelliJ according to my own guide, which by the way, worked exactly the same.

 

But then, when it came time to run my code via moai-fmod-ex I got an error along the lines of error ./libfmodex.dylib does not exist which makes sense in the end.  The Moai Mac host is built to expect the FMOD dylib to be in the same directory as executable.  Problem is, when you run it as a tool within IntelliJ and give it a different working directory, it will not find the DLL.  I tried setting the path using DYLD_LIBRARY_PATH, but oddly this didn't work.  I did manage to get the Moai host running by using the bizarrely named install_name_tool, which also presented a new challenge.

 

Apparently… Xcode used to install this tool in the /usr/bin directory, but then they changed it to the /Developer/usr/bin directory… then apparently they changed it again to the /Applications/Xcode.app/Contents/Developer/usr/bin/ folder, which is not in the PATH and is a pain in the ass to type, so I copied it to /usr/bin ( sudo required).

 

I then relocated the path to the dylib by:

change to moai fmod host directory

install_name_tool -change './libfmodex.dylb' '/path/to/dylib/file/libfmodex.dylb' moai-fmod-ex

 

 

Now it runs properly from within IntelliJ. 

General


19. September 2012

The ignore me part of this post is very real, this post has content that is probably of very little interest to 99% of you.  You see, until now I have been spoiled by the wonderful ( and free! ) Windows Live Writer blogging software, part of the Windows Live Essentials package.  Coincidentally that pack also includes a very good video editing package, so if you have written it off as garbage, you've made a serious mistake.

 

 

Anyways, Windows Live Writer seems to be universally regarded as the best blogging software out there ( Google it… this shocked me too! ), and on a Mac there is no good (free) alternative.  There is however hope, in the form of MarsEdit which I am currently giving a test drive in this post.  It's 40$, which compared to free is quite expensive, but compared to say…  kobe beef, is extremely cheap.  It's quite simple initially, but seems to do most of what I require so far…  mind you, I haven't posted any images or source code yet, so who knows what is going to happen.  I also haven't tried editing an existing post ( too afraid ), or editing a MarsEdit post in WLW ( I haven't got one yet. )

 

So that is what this post is all about… test driving MarsEdit and then seeing how friendly it plays with Windows.  So, the rest of this post is going to be a mish-mash of … stuff.

 

So, feel free to ignore me :)  Unless of course, you too recently added a Mac to your daily regime and are looking for a blogging alternative to Live Writer.  Oh, and I tried QTM already ( it was free ), and…  yeah, no.

 

The good news so far is, it spoke to my blog, got all the recent posts and downloaded the categories, which is nice as I use a slightly less common blog platform ( BlogEngine ).  That said, I haven't seen support for tags yet...

 

Now lets give an image a shot.

 

This is a centre aligned image ( of Oolong, the famous pancake balancing rabbit.  It appears you can position easily enough, but image effects and wrapping text

Oolong

around the image is beyond MarsEdit.

 

Now lets see what happens with a right aligned image, If this text can't be wrapped around an image, that is actually a gigantic deal breaker right there.

Oolong

 

Hmm, well it appears I can at least do that much, but I don't appear to be able to set the padding between my text and the image.

 

 

Perhaps even more oddly, I don't have the ability to resize an image once it has been added.

 

That frankly is just bizarre.

 

Also, I am just typing this stuff so I can fill the space to the bottom of the image.  Not that I can guarantee that will make sense once published, as this column of text doesn't come close to matching the actual width of my blog, so I have no idea how the text is going to format once posted.

 

Now it's time to see how code gets pasted:

 

var express = require('express'),
server = express.createServer();

server.use('/scripts', express.static(__dirname + '/scripts'));

server.get('/', function (req, res) {
res.sendfile('index.html');
});

//server.get('*', function (req, res) {
// res.redirect('/#' + req.url, 302);
//});

server.listen(process.env.PORT || 3000);

 

Hm, default from WebStorm, it pastes as simple text.  Well, that's not going to work.  There doesn't appear to be any plugin support, so let's try pasting as RTF from the wonderful Sublime Text:

 

viewport = MOAIViewport.new()
viewport:setSize(screenWidth,screenHeight)
viewport:setScale(screenWidth,screenHeight)

 

 

Hmmm, nope.  HTML maybe?

 

viewport = MOAIViewport.new()

viewport:setSize(screenWidth,screenHeight)

viewport:setScale(screenWidth,screenHeight)

 

main.lua

09/19/12 10:04:21 /Users/Mike/Dropbox/Moai/Adventure/2/main.lua
  5
if screenWidth == nil then screenWidth =640 end
  6
if screenHeight == nil then screenHeight = 480 end
  7  
  8
MOAISim.openWindow("Window",screenWidth,screenHeight)
  9  
10
viewport = MOAIViewport.new()
11
viewport:setSize(screenWidth,screenHeight)
12
viewport:setScale(screenWidth,screenHeight)

 

 

 

… well, getting there, but ugly as sin.  Thats using the ExportHtml plugin for Sublime Text.  I will look in to a better option in the future.

 

EDIT: Opened and edited in MarsEdit.  No tag support, picture formatting is meh at best and I am not happy with code markup yet, but the basics are there for now.  May have made progress with code formatting:

 

09/19/12 10:26:20 /Users/Mike/Dropbox/Moai/Adventure/2/main.lua 
17 MOAIRenderMgr.pushRenderPass(layer)
18
19 sprite = MOAIGfxQuad2D.new()
20 sprite:setTexture("smile.png")
21 sprite:setRect(-200,-200,200,200)
layer = MOAILayer2D.new()
layer:setViewport(viewport)
 
MOAIRenderMgr.pushRenderPass(layer)
 
sprite = MOAIGfxQuad2D.new()
sprite:setTexture("smile.png")

sprite:setRect(-200,-200,200,200)

EDIT2: Pages opens and edits fine in Live Writer.

 

 

Verdict:

 

MarsEdit may work for me, but the lack of built in code formatting makes things a gigantic pain in the hoop, as do the lack of image formatting tools and (albeit a minor point) the lack of tagging.  On the other hand, I really do like the editing environment, it’s a much nicer and more natural experience than Live Writer.  The publishing process is also much nicer, as is the management aspects.

 

On the whole, MarsEdit seems like a capable product that falls short in a few key categories.  If I find nothing else, I will probably purchase a license.  Does anyone have another recommendation for Mac based blogging software?z

Totally Off Topic


AppGameKit Studio

See More Tutorials on DevGa.me!

Month List