-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.lua
More file actions
43 lines (30 loc) · 728 Bytes
/
test.lua
File metadata and controls
43 lines (30 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--[[
Plastic Lua Wrap color theme test file
]]
---@class Foo
Foo = Core.class()
---
--- Create a new Foo
function foo:init()
self.foobar = 'foobar'
end
---
--- Multiply the given number by a random amount
---@param input number Number to multiply
---@return number Multiplied number
function foo:bar(n)
return n * math.random() * 100
end
local foo = Foo.new() -- Let's make foo!
local rng, cos = math.random, math.cos -- Localize these
local n = foo:bar(rng(1, 15)) -- Bar that foo!
-- Now for the actual Gideros API!!!
local t = Texture.new('test.png')
local b = Bitmap.new(t)
local s = Sprite.new()
s:addChild(b)
s:setPosition(128, 256)
local x, y = s:getPosition()
for i = 1, 10 do
print(rng(1, 10))
end