This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------------------------- | |
-- | |
-- how to calculate the area of a square | |
-- | |
----------------------------------------------------------------------------------------- | |
local lengthOfSquareTextField = native.newTextField( display.contentCenterX, display.contentCenterY + 200, 450, 75 ) | |
lengthOfSquareTextField.id = "length textField" | |
local areaOfSquareTextField = display.newText( "Answer", display.contentCenterX, display.contentCenterY - 200, native.systemFont, 75 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------------------------- | |
-- | |
-- main.lua | |
-- | |
-- Created by: Mr. Coxall | |
-- Created on: Jan 2018 | |
-- | |
-- This file prints "Hello, World!" to the console | |
----------------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------------------------- | |
-- | |
-- how to add a background color and an image to your screen | |
-- | |
----------------------------------------------------------------------------------------- | |
-- Set default screen background color to blue | |
display.setDefault( "background", 0, 0, 1 ) | |
-- note that the image is saved in a directory ./assests/sprites/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------------------------- | |
-- | |
-- how to add text to the screen | |
-- | |
----------------------------------------------------------------------------------------- | |
local myText = display.newText( "Hello World!", 100, 200, native.systemFont, 16 ) | |
myText:setFillColor( 1, 0, 0 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------------------------- | |
-- | |
-- how to add an event listener, so that when you touch an image you get feedback | |
-- | |
----------------------------------------------------------------------------------------- | |
local soccerBall = display.newImageRect( "./assets/sprites/ball.png", 500, 480 ) | |
soccerBall.x = display.contentCenterX | |
soccerBall.y = display.contentCenterY | |
soccerBall.id = "ball object" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by: omz | |
# Created on: Feb 2016 | |
# base code from: | |
# https://gist.github.com/Mr-Coxall/4144acc87c6cc503b84c0e5dfe79fbcf | |
# Altered by: Mr. Coxall | |
# Created on: Nov 2016 | |
# Used to write out a single file selected from the sharesheet and | |
# then write it out to your in your Pythonista directory that you select |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by: Anna Devlin | |
# Created on: Dec 2016 | |
# Created for: ICS3U | |
# This scene shows the main game | |
from scene import * | |
import ui | |
from numpy import random | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from: https://forum.omz-software.com/topic/1239/extracting-the-date-from-the-ui-date-and-time-spinner/6 | |
import ui | |
a_date = None | |
def date_picker_action(sender): | |
my_date = sender.date | |
print(my_date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by: omz | |
# Created on: Feb 2016 | |
# base code from: | |
# https://gist.github.com/Mr-Coxall/4144acc87c6cc503b84c0e5dfe79fbcf | |
# Altered by: Mr. Coxall | |
# Created on: Nov 2016 | |
# Used to write out a single file selected from the sharesheet and | |
# then write it out to your in your Pythonista directory that you select |