Kickstarter project to develop tools for 2d games

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
bartoleo
Party member
Posts: 118
Joined: Wed Jul 14, 2010 10:57 am
Location: Savigliano

Kickstarter project to develop tools for 2d games

Post by bartoleo »

Kickstarter project to develop tools for 2d games
with exporters in lua
http://www.kickstarter.com/projects/skn ... ade-easier
Bartoleo
skn3
Prole
Posts: 7
Joined: Tue Nov 06, 2012 3:21 pm

Re: Kickstarter project to develop tools for 2d games

Post by skn3 »

Hey there I am Jon, the creator of Objecty. Thanks for posting this. I am currently hard at work to try and get a demo pushed out there for people to try.

We really could do with all the support you guys can give and if you have any questions then please ask me via email, twitter, via kickstarter or on here.

To give you an idea of how the exporters can work, I recently experiemented with an MMF2 exporter. You can see a screenshot here.
Image

This consists of only 2 files.

XML file to describe the exporter

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<exporter version="1.0">
	<details>
		<icon>icons/mmf2.png</icon>
		<formats>
			<format class="image">png</format>
		</formats>
		<title>
			<language name="english">MMF2</language>
		</title>
		<description><language name="english">Export the sprite sheet as a png that can be imported by mmf2 using the box mode import.</language></description>
	</details>
	
	<scripts>
		<script>lua/mmf2.lua</script>
	</scripts>
	
	<settings>
		<setting id="hotspot" class="bool" value="1">
			<title><language name="english">Export Hotspot</language></title>
		</setting>
		<setting id="action_point" class="node_reference" value="0">
			<configurations>
				<configuration id="query">node_id(${node.unique_id})/node_class(spriteFrame)/node_id(\${node.atlas_item})/node_class(hotspot)/filter_unique_attribute(id)</configuration>
				<configuration id="style">list</configuration>
				<configuration id="preview">0</configuration>
				<configuration id="can_edit">1</configuration>
				<configuration id="can_reset">1</configuration>
			</configurations>
			<title><language name="english">Export Action Point</language></title>
		</setting>
		<setting id="transparent_color" class="color" value="255,0,255">
			<title><language name="english">Transparent Color</language></title>
		</setting>
	</settings>
</exporter>
LUA script to perform the export operation

Code: Select all

function export(animation)
	-- get some settings
	transparentR,transparentG,transparentB = Setting("transparent_color")
	hotspot = Setting("hotspot")
	actionPoint = Setting("action_point")
	
	-- get the frames from the animation
	frames = animation:GetChildrenWithClass("spriteFrame")
	framesTotal = #(frames)
	
	-- first get some layout details for frames
	frameWidth,frameHeight,frameOffsetX,frameOffsetY = animation:GetDimensions()
	
	-- figure out the size of the output image
	imageWidth = ((frameWidth+3) * framesTotal)+1
	imageHeight = frameHeight+4
	
	-- create output image
	image = CreateImage(imageWidth,imageHeight)
	
	-- get colors for box stuff
	if transparentR == 255 and transparentG == 255 and transparentB == 255 then
		borderR = 254
		borderG = 254
		borderB = 254
	else
		borderR = 255
		borderG = 255
		borderB = 255
	end
	
	if transparentR == 200 and transparentG == 200 and transparentB == 200 then
		pointR = 199
		pointG = 199
		pointB = 199
	else
		pointR = 200
		pointG = 200
		pointB = 200
	end
	
	-- render the frames onto the output image
	renderX = 0
	renderY = 0
	for index,frame in ipairs(frames) do
		-- get frame details
		frameCenterX,frameCenterY = frame:GetCenter()
		
		-- draw transparent
		image:Rect(renderX,renderY,frameWidth+4,frameHeight+4,false,transparentR,transparentG,transparentB,255,false)
		
		-- draw the frame
		image:Paste(frame:GetImage(),renderX+2+frameOffsetX-frameCenterX,renderY+2+frameOffsetY-frameCenterY,255,false)

		-- draw the border
		image:Rect(renderX+1,renderY+1,frameWidth+2,frameHeight+2,false,borderR,borderG,borderB,255,false)
		
		-- draw the hotspot
		if hotspot then
			hotspotX = (frameOffsetX-frameCenterX) + frameCenterX
			hotspotY = (frameOffsetY-frameCenterY) + frameCenterY
			DebugLog(hotspotX.."x"..hotspotY)
			if hotspotX >= 0 and hotspotX < frameWidth and hotspotY >= 0 and hotspotY < frameHeight then
				image:Plot(renderX+1+hotspotX,renderY+1,pointR,pointG,pointB,255,false)
				image:Plot(renderX+1,renderY+1+hotspotY,pointR,pointG,pointB,255,false)
			end
		end
		
		-- draw the action point
		if actionPoint then
			actionPointX = 3
			actionPointY = 10
			if actionPointX >= 0 and actionPointX < frameWidth and actionPointY >= 0 and actionPointY < frameHeight then
				image:Plot(renderX+1+actionPointX,renderY+2+frameHeight,pointR,pointG,pointB,255,false)
				image:Plot(renderX+2+frameWidth,renderY+1+actionPointY,pointR,pointG,pointB,255,false)
			end
		end
		
		-- move the render offset
		renderX = renderX + frameWidth + 3
	end
	
	-- save the image
	image:Save("mmf2_output2.png")
	image:Close()
end
From this particular plugin the output would be:
Image

This cane be imported directly into mmf2. This is still in development and I definitely want to try and support many frameworks and languages, LOVE included.

thanks

Jon
zapaman
Prole
Posts: 13
Joined: Sat Aug 25, 2012 5:54 pm
Location: Romania | Bucharest
Contact:

Re: Kickstarter project to develop tools for 2d games

Post by zapaman »

Seems like a neat tool. I wonder though, will it support Linux? Doing most of my dev on it nowadays.
skn3
Prole
Posts: 7
Joined: Tue Nov 06, 2012 3:21 pm

Re: Kickstarter project to develop tools for 2d games

Post by skn3 »

zapaman wrote:Seems like a neat tool. I wonder though, will it support Linux? Doing most of my dev on it nowadays.
This is one of the stretch goals of the project so it is a possibility. It really depends how much interest there is. The windows version is main development, mac libraries are nearly ready but the linux libraries need to be worked on!
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Kickstarter project to develop tools for 2d games

Post by Nixola »

I'd like it too
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
skn3
Prole
Posts: 7
Joined: Tue Nov 06, 2012 3:21 pm

Re: Kickstarter project to develop tools for 2d games

Post by skn3 »

Nixola wrote:I'd like it too
cool!

well show you support back the project and hopefully we can push past the goal to get a linux version done. :3
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Kickstarter project to develop tools for 2d games

Post by Kadoba »

This is a really cool idea for a tool. Animations and collision shapes are definitely way easier to do visually. How restrictive is your indie license and what would the cost be once Objecty is released?
skn3
Prole
Posts: 7
Joined: Tue Nov 06, 2012 3:21 pm

Re: Kickstarter project to develop tools for 2d games

Post by skn3 »

Kadoba wrote:This is a really cool idea for a tool. Animations and collision shapes are definitely way easier to do visually. How restrictive is your indie license and what would the cost be once Objecty is released?
The indie license would essentially be a low price yearly subscription and contain all of the features of Objecty. A final price has not been decided yet for the pro or studio versions but you are getting a good price if you go with the kickstarter pricing!

Now let me just say "price" again just because I didn't say it enough in that reply already :ultrahappy:
User avatar
Xgoff
Party member
Posts: 211
Joined: Fri Nov 19, 2010 4:20 am

Re: Kickstarter project to develop tools for 2d games

Post by Xgoff »

>MMF2 exporter

wow that's a blast from 2008
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: Kickstarter project to develop tools for 2d games

Post by jjmafiae »

skn3 wrote:
Kadoba wrote:This is a really cool idea for a tool. Animations and collision shapes are definitely way easier to do visually. How restrictive is your indie license and what would the cost be once Objecty is released?
The indie license would essentially be a low price yearly subscription and contain all of the features of Objecty. A final price has not been decided yet for the pro or studio versions but you are getting a good price if you go with the kickstarter pricing!

Now let me just say "price" again just because I didn't say it enough in that reply already :ultrahappy:

about prices how much will this cost? looks SO AWSOME!
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 3 guests