Hello i am new to codea and i need some help to My app
I need help with sending a mail in the app
The code is
function setup()
print("hello christmas")
parameter.integer("SpriteWidth", 20, 700, 100)
parameter.integer("spriteWidth", 20, 700, 100)
parameter.integer("spriteWidth", 20, 700, 100)
parameter.text("TitleText", "merry christmas!", function(t) print(t) end )
parameter.watch("string.upper(TitleText)")
end
function draw()
background(255, 43, 0, 255)
sprite("Planet Cute:Tree Tall", WIDTH/2, HEIGHT/3, SpriteWidth)
sprite("Planet Cute:Star", WIDTH/2, HEIGHT/2, spriteWidth)
sprite("Documents:frost", WIDTH/2, HEIGHT/2, 799)
fill(255, 255, 255, 255)
fontSize(60)
font("HoeflerText-BlackItalic")
textWrapWidth(WIDTH)
text(TitleText, WIDTH/2, HEIGHT - 160)
end
Prynok
December 15, 2013, 3:25pm
2
function setup()
print("hello christmas") parameter.integer("SpriteWidth", 20, 700, 100) parameter.integer("spriteWidth", 20, 700, 100) parameter.integer("spriteWidth", 20, 700, 100) parameter.text("TitleText", "merry christmas!", function(t) print(t) end ) parameter.watch("string.upper(TitleText)")
end
function draw()
background(255, 43, 0, 255)
sprite("Planet Cute:Tree Tall", WIDTH/2, HEIGHT/3, SpriteWidth)
sprite("Planet Cute:Star", WIDTH/2, HEIGHT/2, spriteWidth)
sprite("Documents:frost", WIDTH/2, HEIGHT/2, 799)
fill(255, 255, 255, 255)
fontSize(60)
font("HoeflerText-BlackItalic")
textWrapWidth(WIDTH)
text(TitleText, WIDTH/2, HEIGHT - 160)
end
I formatted the code for you, let me see what the problem is.
@Prynok It’s not a problem, they want to know how to send mail. (And the paramaters were formatted fine)
@Gamerage13 There’s not an official way, but sort of cheats using openURL(). @Zoyt made an example of it (including opening the Mail app) here .
You could also probably run an http.request to some Google URL to send mail too, but I’m not sure how that works.
@Gamerage13 Also, sorry, forgot, but welcome to the Codea Forums!
I also want to be able to move the Christmas tree and the star
I haved try but it did not work it only change the size of the sprite
What do i need to do?
Ignatz
December 15, 2013, 5:28pm
8
@Gamerage13 - have you done any of the tutorials on the wiki link above? You shouldn’t be trying to write apps until you have done this, as we are not here to teach you basic stuff.
Zoyt
December 15, 2013, 6:00pm
9
@Gamerage13 - You can also see how to send mail through PHP without popping up the mail form here .
But for that, you need a server.
@Prynok , hows is that formatting any better than his was? To me, his looks much closer to being properly formatted.
Also @Gamerage13 , as Zoyt said the only way to send an email directly is to have a server.
Prynok
December 15, 2013, 9:19pm
11
@JakAttak I was just putting all his code in the “~~~” since It wasn’t. It looks like he edited, though.
I think I’ll take and look at the wiki website
And see if i can find Any tutorials.
And thanks for the help :)>-
how to draw grass ground?
Prynok
December 16, 2013, 2:01pm
14
function setup()
end
function draw()
background(0,0,0,255)
sprite("WhateverTheSpriteNameIs",x,y)
end
Thanks @prynok But one problem it says bad argument got nil
Prynok
December 16, 2013, 2:40pm
17
@Gamerage13 You hae to set the string to the sprite name, and the x and y to the coordinates.
function setup()
to = "someone@email.com"
cc = "copy@email.com"
subject = "This is the subject"
str1="this is the first line"
str2="\
this is the second line"
str3="\
this is the third line"
message=str1..str2..str3
create(to, cc, subject, message)
end
function create(to, cc, subject, body)
url = "mailto:"..to.."?cc="..cc.."&subject="..code1(subject).."&body="..code1(body)
openURL(url)
end
function code1(str)
crlf = "%a%d-_.~"
return string.gsub(str, "[^"..crlf.."]", code2)
end
function code2(c)
return string.format ("%%%02X", string.byte(c))
end
Written by @Dave1707
@prynok ok thanks for Grass ground
And thanks @dave1707 for mail code! :)>-
@prynok im using
Sprite(“example”,width/2, height/2)
End