Project Images

Is there not a way to include our own project images - as in how they appear in the examples? I tried adding:
<key>Icon</key> <string>name.png</string>

To my Info.plist file in my directory and it didn’t show up. Tried grabbing one of the examples and moving them to Documents, tried grabbing its images “Project3DLab.png” and “Project3DLab@2x.png” and dropping them into Documents, Sprites, and the actual project directory.

Am I missing something? (Also tried closing Codea and reopening)

I believe the undocumented way to do this (for now), is:

saveImage( "Project:Icon", myImage )

hmm couldn’t get this to work. @Simeon do I put this under saveProjectInfo and how and where do I insert my image?

Interesting idea. I would like to use it.

@veeeralp, for me, Codea did not show any error, but does not work.

I tried something like:

myImage = sprite("Documents:ExampleCircle")
saveImage("Project:Icon", myImage);

@Georgian your code would need to be

myImage = readImage("Documents:ExampleCircle")
saveImage("Project:Icon", myImage)

(This assumes “Documents:ExampleCircle” exists.)

@Simeon, I tried this and doesn’t work.

Icon of the project was not changed, maybe the icon was not saved.

I tried this for test if the Icon was saved:

sprite("Project:Icon", WIDTH/2, HEIGHT/2) //not work
sprite("Documents:ExampleCircle", WIDTH/2, HEIGHT/2) //Work

Got any ideas? :-?

@Georgian and @Simeon yeah this isn’t working for me either. I even restarted my device

I’m at work so I can’t check this right now, but when we develop web apps we add an image called “apple-touch-icon.png” to the root folder which is either 57x57 or 114x114 which functions as a “desktop” favicon. The iPad is supposed to automatically assign it. This is sandboxed though, so I doubt it would work.

But maybe?

I’ll have to check. I thought this feature was in there.

Bei mir klappt die Kopie mit folgendem Code einwandfrei.


-- Copie from Sprite Packs to Documents

-- Use this function to perform your initial setup
function setup()
    print("Hello World!")
    myImage = readImage("Planet Cute:Character Pink Girl")
    saveImage("Documents:PinkGirl",myImage)
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(40, 40, 50)

    -- This sets the line thickness
    strokeWidth(5)

    -- Do your drawing here
    sprite(myImage,200,200)
end

Das funktioniert auch mit eigenen Bildern

-- Copie from Sprite Packs to Documents

-- Use this function to perform your initial setup
function setup()
    print("Hello World!")
    myImage = readImage("Planet Cute:Character Pink Girl")
    saveImage("Documents:PinkGirl",myImage)
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(40, 40, 50)

    -- This sets the line thickness
    strokeWidth(5)

    -- Do your drawing here
    sprite(myImage,200,200)
end

@matox it’s not just the copy — that works. It’s actually setting the project’s icon on the home screen.

“Project:Icon” is supposed to be a special location that sets the image used to represent the project on the home screen.

@Simeon , Have you managed to find out how to change project’s icon?

Or you will solve this problem in the next update?

Ah just figured it out. The “Project:Icon” thing works in the beta version of Codea, because it doesn’t clean up your project folder of extraneous files.

We’ll have to restructure the way project clean-up works in the release version before this feature becomes available.