Changes

Jump to navigation Jump to search

Changes in OS 3.2

38 bytes added, 13:40, 5 June 2012
no edit summary
Line 9: Line 9:  
'''All''' documents created for 3.1 and previous will run in that apiLevel by default. This is because some changes in the XML structure of the document. So most programs and games should run fine by default.<br /> Then there is apiLevel 2.0. This apiLevel has some big changes to the API structure, so you will have to update some of your code in order to have some of they new 3.2 stuff. However, it is currently not possible to create apiLevel 2.0 documents with [[Luna]] due to changes in the XML structure. I have given the details of the changes to ExtendeD so he will probably update Luna soon.<br />
 
'''All''' documents created for 3.1 and previous will run in that apiLevel by default. This is because some changes in the XML structure of the document. So most programs and games should run fine by default.<br /> Then there is apiLevel 2.0. This apiLevel has some big changes to the API structure, so you will have to update some of your code in order to have some of they new 3.2 stuff. However, it is currently not possible to create apiLevel 2.0 documents with [[Luna]] due to changes in the XML structure. I have given the details of the changes to ExtendeD so he will probably update Luna soon.<br />
 
For the best support and guarantee that you are using the correct apiLevel, you should add the following to the top of new Lua documents you create:
 
For the best support and guarantee that you are using the correct apiLevel, you should add the following to the top of new Lua documents you create:
:''platform.apiLevel = '1.0''' or ''platform.apiLevel = '2.0'''
+
:''platform.apiLevel = "1.0"'' or ''platform.apiLevel = "2.0"''
 
<br />
 
<br />
 
Please note that using [[platform.apiLevel|apiLevel]] 2.0 with the current Luna will result in an error.<br />
 
Please note that using [[platform.apiLevel|apiLevel]] 2.0 with the current Luna will result in an error.<br />
Line 20: Line 20:  
* Most graphical operations are now anti-aliased.  
 
* Most graphical operations are now anti-aliased.  
 
* [[gc:setColorRGB]] now supports one number as input (as well as the old style). For example, you can do [[gc:setColorRGB]](0xFF00CC) or [[gc:setColorRGB]](0)
 
* [[gc:setColorRGB]] now supports one number as input (as well as the old style). For example, you can do [[gc:setColorRGB]](0xFF00CC) or [[gc:setColorRGB]](0)
* You can not use coordinates for drawing to the screen above/under (-) 32 000. Normally this shouldn't affect anyone, but because of this Cubefield refuses to run.
+
* You can not use coordinates for drawing to the screen above/under (-) 32 000. (Be careful, some scripts might need to take that into account now, or they may crash)
 
* In [[platform.apiLevel|apiLevel]] 2.0, [[platform.gc]]() is removed and replaced with [[platform.withGC]](). An example of it:<br />  
 
* In [[platform.apiLevel|apiLevel]] 2.0, [[platform.gc]]() is removed and replaced with [[platform.withGC]](). An example of it:<br />  
<code>function getStringWidth(gc, str)
+
<syntaxhighlight>function getStringWidth(gc, str)
return gc:getStringWidth(str)
+
  return gc:getStringWidth(str)
 
end
 
end
 
function on.construction()
 
function on.construction()
local strw = platform.withGC(getStringWidth, "The game")
+
  local strw = platform.withGC(getStringWidth, "The game")
end</code>
+
end</syntaxhighlight>
So what it does it call the function you give as first argument and pass a dummy GC to it.  
+
So what it does it call the function you give as first argument and pass a dummy [[gc|GC]] (Graphics Context) to it.  
    
==D2Editor==
 
==D2Editor==
[[D2Editor|D2Editor]] had been greatly improved <br />  
+
[[D2Editor|D2Editor]] has been greatly improved <br />  
    
==Require==
 
==Require==
Line 41: Line 41:     
==Physics==
 
==Physics==
Maybe the best part of it of. OS 3.2 now includes the Open Source Chipmunk [[Physics_Engine|Physics engine]], and you can use it right from Lua!<br /> This will allow some great games and applications <br /> Tutorials aobut it coming soon.<br />
+
Maybe the best part of it of. OS 3.2 now includes the Open Source Chipmunk [[Physics_Engine|Physics engine]], and you can use it right from Lua!<br /> This will allow some great games and applications <br /> Tutorials about it coming soon.<br />
    
==Image==
 
==Image==
[[image.rotate]]. This allows you to rotate images in anyway.<br />
+
[[image.rotate]]. Performs images rotation.<br />
    
==Math==
 
==Math==

Navigation menu