Costume image file picker

Post your nifty GP projects here!

Moderators: MSandro, MSandro, MSandro

Post Reply
SimpleSi
Posts: 261
Joined: Jul 2nd, '17, 13:47

Costume image file picker

Post by SimpleSi » Oct 5th, '17, 16:53

Manged to mangle together a few blocks to give my self a basic image file picker for costumes

Although it doesn't change the image in the images tab - the selected costume survives the project beign opened and closed so it'll do for now

(I've converted all Scratch images into .png and put them inside my GP folder

Just going to add a bit of navigation and then I'll upload the script
Attachments
0.png

SimpleSi
Posts: 261
Joined: Jul 2nd, '17, 13:47

Re: Costume image file picker

Post by SimpleSi » Oct 6th, '17, 11:11

Done a bit more work and here is what should be a working version as both a project and a class

from Project notes

Code: Select all

Special utility block (not intended to be put inside a script) that lets you choose a costume from 
images in your GP folder 


To use

Click on the block (preferably direct from MyBlocks) and then select an image
The image will be temporarily applied as the costume so you can see it

You can then click OK to select and add it to Images tab

Or press Cancel to restore original costume

Or view another image

The only know issue is the fact that the menu of files will move down and across the screen on 
each mouse-click :)

Hopefully I can can find a method of avoiding this in future versions :)

JFI If you go to the end of my Scratch to GP article - you can find a link to a zipped file of all the 
Scratch costumes (converted to .png from .gif where needed)

AFAIK, these images are free to use outside of Scratch under the terms of the Creative 
Commons Attribution-ShareAlike 2.0 license 
Attachments
costumeUTILITY.gp
(1.68 KiB) Downloaded 2 times
costumeUTILITY01.gpp
(7.27 KiB) Downloaded 2 times

SimpleSi
Posts: 261
Joined: Jul 2nd, '17, 13:47

Re: Costume image file picker

Post by SimpleSi » Oct 6th, '17, 21:37

Found more engine room code I can re-use

It now has option of viewing thumbnails of the .png files (click on drawer to set option)

Please note - it can take a noticeable amount of time when in thumbnail mode for the filelist to appear so please be patient :)
Attachments
costumeUTILITY.gp
(3.42 KiB) Downloaded 2 times
costumeUTILITY07.gpp
(25.26 KiB) Downloaded 4 times

JohnM
Posts: 261
Joined: Sep 11th, '15, 14:42

Re: Costume image file picker

Post by JohnM » Oct 6th, '17, 22:54

Nifty!

Post Reply