Last active
July 1, 2018 02:44
-
-
Save Mr-Coxall/a2642b76d95cb8a7d8f8836c43366430 to your computer and use it in GitHub Desktop.
images.pyui
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: Mr. Coxall | |
# Created on: Aug 2018 | |
# Created for: ICS3U | |
# This program shows images | |
import ui | |
# first get a reference to the image you saved in your Python folder | |
my_pic = ui.Image.named('./sprites/MT_crest.jpg') | |
# then create an ImageView to show it in | |
my_image = ui.ImageView(frame=(100, 100, 200, 300)) | |
# then add the image into the ImageView | |
my_image.image = my_pic | |
view = ui.load_view() | |
# lastly, add the Imageview into the existing view | |
view.add_subview(my_image) | |
view.present('full_screen') |
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
[ | |
{ | |
"selected" : false, | |
"frame" : "{{0, 0}, {1024, 768}}", | |
"class" : "View", | |
"nodes" : [ | |
{ | |
"selected" : true, | |
"frame" : "{{462, 334}, {100, 100}}", | |
"class" : "ImageView", | |
"nodes" : [ | |
], | |
"attributes" : { | |
"flex" : "LRTB", | |
"frame" : "{{462, 334}, {100, 100}}", | |
"image_name" : "iob:social_github_outline_256", | |
"class" : "ImageView", | |
"name" : "github_sprite", | |
"uuid" : "84016779-A647-43CA-8F71-246CD6E2B6BD" | |
} | |
} | |
], | |
"attributes" : { | |
"name" : "", | |
"enabled" : true, | |
"background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)", | |
"tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)", | |
"border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)", | |
"flex" : "" | |
} | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment