Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

I am new to codea and need some help

edited December 2013 in Questions Posts: 32

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

Comments

  • Posts: 577
    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.

  • Posts: 1,976

    @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.

  • edited December 2013 Posts: 32

    Ok thanks

  • Posts: 1,976

    @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?

  • IgnatzIgnatz Mod
    Posts: 5,396

    @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.

  • Posts: 2,820

    @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.

  • Posts: 2,042

    @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.

  • Posts: 577

    @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?

  • Posts: 577

    ~~~
    function setup()

    end

    function draw()
    background(0,0,0,255)
    sprite("WhateverTheSpriteNameIs",x,y)
    end

  • Thanks!! @prynok

  • Thanks @prynok But one problem it says bad argument got nil

  • Posts: 577

    @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="\nthis is the second line"
        str3="\nthis 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! :)>-

  • edited December 2013 Posts: 32

    @prynok im using
    Sprite("example",width/2, height/2)

    End

  • Posts: 577

    @Gamerage13 Here is what you did wrong:

    There is no sprite named "name." WIDTH also has to be all uppercase. Also, its HEIGHT, not heigt.

  • @prynok It was an example...
    I now how to do it right but i was only asking if this example are like yours example?

  • And how do I use x and y coordination?
    Give me an short example and I fix everything. :)

  • Posts: 577

    Here is an example of coordinates: http://goo.gl/FvX47Z

    Just plug numbers into the x and y slots.

  • edited April 2014 Posts: 32

    Ok thanks

  • edited December 2013 Posts: 32

    Another question can i make an yojstick to My game

Sign In or Register to comment.