Changes

Jump to navigation Jump to search

image.new

319 bytes added, 18:31, 28 March 2014
Line 28: Line 28:  
<syntaxhighlight>
 
<syntaxhighlight>
 
-- For ApiLevel < 2.3 (OS < 3.6) :
 
-- For ApiLevel < 2.3 (OS < 3.6) :
image.new("\002\000\000\000\002\000\000\000\000\000\000\000\004\000\000\000\016\000\001\000\255\255\255\255\255\255\255\255")
+
img = image.new("\002\000\000\000\002\000\000\000\000\000\000\000\004\000\000\000\016\000\001\000\255\255\255\255\255\255\255\255")
    
-- For ApiLevel >= 2.3 (OS >= 3.6) :
 
-- For ApiLevel >= 2.3 (OS >= 3.6) :
image.new(_R.IMG.img_1)</syntaxhighlight>
+
img = image.new(_R.IMG.img_1)
    +
-- Example from Jim Bauwens:
 +
-- Of course if you have many images you just could use a for loop to do that for every image :
 +
myImages = {}
 +
for img_name, img_resource in pairs(_R.IMG) do
 +
        myImages[img_name] = image.new(img_resource)
 +
end
 +
-- that way you could do
 +
gc:drawImage(myImages.img_1, 10, 10)</syntaxhighlight>
    
== See also  ==
 
== See also  ==

Navigation menu