Are there secret functions that aren’t documented in the reference page?
@PlatinumFrog I usually do this for every version so I can see what’s different from one version to the next. Look thru the list and see if there’s anything you don’t recognize .
Codea version 2.5
--- variables ---
ADDITIVE
ANY
BACK
BACKSPACE
BEGAN
CAMERA
CAMERA_BACK
CAMERA_FRONT
CANCELLED
CENTER
CHAIN
CIRCLE
COMPOUND
CORNER
CORNERS
ContentScaleFactor
CurrentOrientation
CurrentTouch
DATA
DECODE
DISABLED
DISTANCE
DST_ALPHA
DST_COLOR
DYNAMIC
DeltaTime
EDGE
ENCODE
ENDED
ElapsedTime
FORMAT_MONO16
FORMAT_MONO8
FORMAT_STEREO16
FORMAT_STEREO8
FRONT
FULLSCREEN
FULLSCREEN_NO_BUTTONS
Gravity
HEIGHT
KINEMATIC
LANDSCAPE_ANY
LANDSCAPE_LEFT
LANDSCAPE_RIGHT
LEFT
MOVING
MULTIPLY
MUSIC
NORMAL
ONE
ONE_MINUS_DST_ALPHA
ONE_MINUS_DST_COLOR
ONE_MINUS_SRC_ALPHA
ONE_MINUS_SRC_COLOR
OVERLAY
POLYGON
PORTRAIT
PORTRAIT_ANY
PORTRAIT_UPSIDE_DOWN
PRISMATIC
PROJECT
RADIUS
RETAINED
RETURN
REVOLUTE
RIGHT
ROPE
ROUND
RotationRate
SHADERS
SOUNDS
SOUND_BLIT
SOUND_EXPLODE
SOUND_HIT
SOUND_JUMP
SOUND_NOISE
SOUND_PICKUP
SOUND_POWERUP
SOUND_RANDOM
SOUND_SAWTOOTH
SOUND_SHOOT
SOUND_SINEWAVE
SOUND_SQUAREWAVE
SPRITES
SQUARE
SRC_ALPHA
SRC_ALPHA_SATURATE
SRC_COLOR
STANDARD
STATIC
STATIONARY
TEXT
UserAcceleration
WELD
WIDTH
ZERO
_G
_VERSION
--- functions ---
alert
applyMatrix
assert
assetList
background
backingMode
blendMode
buffer
camera
cameraSource
class
clearLocalData
clearOutput
clearParameters
clearProjectData
clip
close
collectgarbage
color
coroutine
createProject
debug
deleteProject
deviceMetrics
displayMode
dofile
draw
ellipse
ellipseMode
error
fill
font
fontMetrics
fontSize
getmetatable
hasProject
hideKeyboard
http
image
io
ipairs
iparameter
isKeyboardShowing
isRecording
json
keyboardBuffer
line
lineCapMode
listGlobalData
listLocalData
listProjectData
listProjectTabs
listProjects
load
loadfile
loadstring
location
math
matrix
mesh
modelMatrix
music
next
noClip
noFill
noSmooth
noStroke
noTint
noise
openURL
ortho
os
output
package
pairs
parameter
pasteboard
pcall
perspective
physics
point
pointSize
popMatrix
popStyle
print
projectionMatrix
pushMatrix
pushStyle
rawequal
rawget
rawlen
rawset
readGlobalData
readImage
readLocalData
readProjectData
readProjectInfo
readProjectTab
readText
rect
rectMode
require
resetMatrix
resetStyle
restart
rotate
rsqrt
saveGlobalData
saveImage
saveLocalData
saveProjectData
saveProjectInfo
saveProjectTab
saveText
scale
select
setContext
setInstructionLimit
setmetatable
setup
shader
showKeyboard
smooth
sound
soundBufferSize
soundbuffer
speech
sprite
spriteBatching
spriteList
spriteMode
spriteSize
startRecording
stopRecording
string
stroke
strokeWidth
supportedOrientations
table
text
textAlign
textMode
textSize
textWrapWidth
tint
tonumber
tostring
touched
translate
triangulate
tween
type
unpack
utf8
vec2
vec3
vec4
viewMatrix
watch
xpcall
zLevel
There seems to be a few things like collectgarbage(), spritebatching(), and the point()/pointsize() functions that aren’t documented. Thanks.
@PlatinumFrog the collectgarbage() function clears all the useless data floating around, it can also be used to figure out the memory being used by saying:
collectgarbage("count")
point() and pointSize() just draw an ellipse, pretty useless because you can just use the ellipse() function.
I’ll leave it to @dave1707 to tell you what spriteBatching() is because he has more experience with it.
I haven’t the slightest idea what spriteBatching is. Doing a google search didn’t turn up anything useful.
@dave1707 sorry, I thought I remembered you doing it on a thread. It was @SkyTheCoder who used it. Basically, @PlatinumFrog , it accepts one parameter which is a boolean, true or false, I remember it being used for separating sprite sheets into single sprites, don’t remember it’s true functionality tho
I think this explains it?:
https://codea.io/talk/discussion/2220/spritebatch-class/p1
How does setInstructionLimit()
work? Why is there io.read()/io.write() when they are useless on an ipad? (unless they aren’t and I’m missing something) By using Lua, is there some contract saying that you can’t delete any functions or modify them, but you can make your own?
@PlatinumFrog setInstructionLimit() sets a limit to the amount of lines of code to be read. For example:
setInstructionLimit(1000)
This will read 1000 lines of code before stopping. Default is 0, which makes it unlimited
@PlatinumFrog io read and write work on the iPad. Do a forum search and you’ll find a lot of examples. I did a lot of stuff with them before we got readtext.
@PlatinumFrog @CamelCoder See this link.
https://bitbucket.org/TwoLivesLeft/core/wiki/setInstructionLimit
EDIT: I don’t think setInstructionLimit works anymore. At least I couldn’t get it to stop a large loop.
@PlatinumFrog setInstructionLimit
is deprecated.
The spriteBatching(bool)
function will enable or disable automatic sprite batching. It’s not meant to be a public API (because sprite batching should just work). But I’ve left it in undocumented in case any one runs into issues with automatic batching and needed to see if that resolves it.
There are two libraries included but undocumented. These are LPEG and LuaSocket. LPEG is used by the JSON library, and LuaSocket is there for anyone who wants to play with sockets.