Codea Word

Check out a vid I made, I will also do the code

…?

Here is the vid like for YouTube, I published it with my account:
http://m.youtube.com/watch?v=k_bWyU2f1_o

and here is the code:


-- Codea Word

-- Use this function to perform your initial setup
function setup()

    parameter.integer("Font", 1, 3)
end

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

        
    background(255, 255, 255, 255)
    font("AmericanTypewriter-Condensed")
cf = os.date()
fill(0, 32, 255, 255)
fontSize(30)
text("Codea Word", 400, 720)
fill(0, 255, 0, 125)
rect(300, 700, 200, 50)

    fill(0, 0, 0, 255)
    
    buffer = keyboardBuffer()
    
    _,bufferHeight = textSize(buffer)
    
 
    if buffer then
          if Font == 1 then
    font("AcademyEngravedLetPlain")
end
if Font == 2 then
    font("AmericanTypewriter-Light")
end
if Font == 3 then
    font("AmericanTypewriter-Bold")
end
        text( buffer, WIDTH/2, 650 - bufferHeight )
        
    
    
    if buffer == "What time is it?" then
        text("ADVENTURE TIME!", 600, 700)
    end
    if buffer == "*Looks at date" then
        text("Date:  " ..cf, 600, 500)
        end
    end
end

function touched(touch)
if touch.tapCount == 1 then
    showKeyboard()
    end
end

Codea is great, isn’t it?

Very useful. Thanks for sharing! :)>-

No problem guys! :wink: I’m also updating it

I just realized that the video is outdated… I’m going to go back and update it and probably make a new vid

Updated… I didn’t share the video, but you can search up iPadtutorial909 Dasmel And view it there

-- Codea Word

-- Use this function to perform your initial setup
function setup()
    parameter.integer("Font", 1, 3)
    parameter.color("FontColor", 0)
    parameter.integer("FontSize", 1, 150)
end

-- This function gets called once every frame
function draw()
    background(255, 255, 255, 255)
    font("AmericanTypewriter-Condensed")
cf = os.date()
fill(0, 32, 255, 255)
fontSize(30)
text("Codea Word", 400, 720)
fill(0, 255, 0, 125)
rect(300, 700, 200, 50)

    fill(FontColor)
    fontSize(FontSize)
    
    buffer = keyboardBuffer()
    
    _,bufferHeight = textSize(buffer)
    
 
    if buffer then
          if Font == 1 then
    font("AcademyEngravedLetPlain")
end
if Font == 2 then
    font("AmericanTypewriter-Light")
end
if Font == 3 then
    font("AmericanTypewriter-Bold")
end
        text( buffer, WIDTH/2, 650 - bufferHeight )
        
    
    
    if buffer == "What time is it?" then
        text("ADVENTURE TIME!", 600, 700)
    end
    if buffer == "*Looks at date" then
        text("Date:  " ..cf, 600, 500)
        end
 if buffer == "OpenLink/Google" then
fill(127, 127, 127, 255)
DGB(400, 500, 100)
fontSize(25)
fill(0, 0, 0, 255)
text("Open", 450, 550)
if CurrentTouch.x >=394 and CurrentTouch.x <=504 and CurrentTouch.y >=494 and CurrentTouch.y <=604 then
openURL("https://www.google.com/", true)
            end
        end
    end
end

function touched(touch)
 showKeyboard()
end

function DGB(x,y,s)
rect(x,y,s,s)
end

I’m working on a whole new version of Codea Word. The release date deadline is almost here. I hope you will like it. Just to give you an idea, there should be a feature to Create New pages, Open the recent page, and Delete the recent page. It should be here in about 2 days.

The new version is here. Some features have been commentated out for future testing.

-- Codea Word

-- Use this function to perform your initial setup
function setup()
--    parameter.integer("Font", 1, 3)
 --   parameter.color("FontColor", 0)
  --  parameter.integer("FontSize", 1, 150)
parameter.action("New Page", function() np() end)

s = 1
n = 2
w = 3
mode = s
CP = 0
end

-- This function gets called once every frame
function draw()

    if mode == s then
    background(0, 255, 164, 255)
    end
    if mode ==n then
          buffer = keyboardBuffer()
    _,bufferHeight = textSize(buffer)
    
 if buffer then
    background(68, 255, 0, 255)
    fill(255, 255, 255, 255)
    rect(300, 300, 100, 100)
    fill(0, 0, 0, 255)
    text(buffer, WIDTH/2, HEIGHT/2)
    parameter.action("Create!", function() create() end)
        end
    end
    if mode == w then
        background(255)
        saveLocalData("Current page", buffer)
        fontSize(75)
        fill(0)
    text(buffer, 350, 600)
    r = keyboardBuffer()
    _,rheigth = textSize(r)
    parameter.integer("Font", 0, 5)
    parameter.integer("Font_Size", 3, 75)
    parameter.color("Font_Fill", 0)
    fonts()
    fontSize(Font_Size)
    fill(Font_Fill)
    textWrapWidth(1000)
    if r then
text(r, WIDTH/2, HEIGHT/2)
        end
    end
  --  font("AmericanTypewriter-Condensed")
--cf = os.date()
--fill(0, 32, 255, 255)
--fontSize(30)
--text("Codea Word", 400, 720)
--fill(0, 255, 0, 125)
--rect(300, 700, 200, 50)

--    fill(FontColor)
 --   fontSize(FontSize)
    
 --   buffer = keyboardBuffer()
    
   -- _,bufferHeight = textSize(buffer)
    
 
   -- if buffer then
    --      if Font == 1 then
   -- font("AcademyEngravedLetPlain")
--end
--if Font == 2 then
    --font("AmericanTypewriter-Light")
--end
--if Font == 3 then
--    font("AmericanTypewriter-Bold")
--end
 --       text( buffer, WIDTH/2, 650 - bufferHeight )
        
    
    
--    if buffer == "What time is it?" then
--text("ADVENTURE TIME!", 500, 500)
   -- end
--if buffer == "*Looks at date" then
  --      text("Date:  " ..cf, 600, 500)
        --end
 --       end
   -- end
end

function touched(touch)
showKeyboard()
end

--function DGB(x,y,s)
--rect(x,y,s,s)
--end

function np()
mode = n
end

function create()
mode = w
end

function Open()
CP = readLocalData("Current page", 0)
end

function fonts()
    if Font == 1 then
        font("AcademyEngravedLetPlain")
        elseif Font == 2 then
        font("AmericanTypewriter")
        elseif Font == 3 then
        font("AmericanTypewriter-Light")
        elseif Font == 4 then
        font("AmericanTypewriter-Bold")
        elseif Font == 5 then
        font("AmericanTypewriter-Condensed")
        end
    end

It’s a lot of work making a text editor, isn’t it?

Your function fonts isn’t necessary. If you put the fonts in a table to start with…

fonts={"AcademyEngravedLetPlain",...}

then when the user makes a selection, you simply use fonts[Font]