Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Coding help please!
Started by Madeline Jan 19 2011 01:42 AM

- - - - -
25 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

Hello! I am new and have just gotten started on my first app. When i go through the example they show me.. it says to type this....
myText = display.newText( "Hello, World!", 20, 40, native.systemFont, 36 )
myText:setTextColor( 255,0,0 )
I do that and then when i relaunch my simulator it doesn't work!
Could somebody recommend what i might be going wrong?
~ Madeline(:
uid: 19141 topic_id: 5205 reply_id: 305205


[TOPIC: post.html]
#2

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

Can someone please help?
uid: 19141 topic_id: 5205 reply_id: 17303


[TOPIC: post.html]
#3

jhocking

[GLOBAL: userInfoPane.html]
jhocking
  • Corona Geek

  • 1,223 posts
  • Guests

[TOPIC: post.html]
#4

IgnacioIturra

[GLOBAL: userInfoPane.html]
IgnacioIturra
  • Contributor

  • 359 posts
  • Guests

What does it say when it doesn't work? Are you saving the text file as main.lua? Otherwise it won't work.
uid: 10835 topic_id: 5205 reply_id: 17361


[TOPIC: post.html]
#5

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

Ignaciolturra, thankyou for replying!
I do exactly what it says, which is typing the code and then saving as a main.lua.. Then once i save i open it in my Corona Simulator. When i open it, it doesnt work it is just a black iPhone screen.
Can you walk me through how to just put plain text in?
uid: 19141 topic_id: 5205 reply_id: 17535


[TOPIC: post.html]
#6

IgnacioIturra

[GLOBAL: userInfoPane.html]
IgnacioIturra
  • Contributor

  • 359 posts
  • Guests

First instead of opening the simulator, open the terminal. It will open the simulator automatically, but you'll be able to see the output of print files and errors there.

The particular hello world you are doing outputs to the terminal and not to the screen! That's why you weren't seeing anything.

I believe there was another Hello World that would output to the screen a little below on the same page. Though get into the habit of opening the terminal first. It's really useful.
uid: 10835 topic_id: 5205 reply_id: 17540


[TOPIC: post.html]
#7

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

Hello! thanks again for replying!!

How do i open the terminal??
uid: 19141 topic_id: 5205 reply_id: 17542


[TOPIC: post.html]
#8

IgnacioIturra

[GLOBAL: userInfoPane.html]
IgnacioIturra
  • Contributor

  • 359 posts
  • Guests

Aaaargh the server seems to have eaten my reply.

Here it goes again:

You are not doing anything wrong, it's actually working. It's just that the hello world you're doing outputs to the terminal, not the device screen.

Instead of opening the simulator, open the terminal. It will also open the simulator automatically. In there you'll see print statements in your code (in this case "Hello World") and also error logs. Get in the habit of using the terminal, it's really useful.

There's another Hello World in there that outputs to the screen

Edit: Huh, I guess it didn't.
uid: 10835 topic_id: 5205 reply_id: 17541


[TOPIC: post.html]
#9

IgnacioIturra

[GLOBAL: userInfoPane.html]
IgnacioIturra
  • Contributor

  • 359 posts
  • Guests

In Applications, Corona.243 the Corona Terminal icon is right next to the simulator one. Just click on it.
uid: 10835 topic_id: 5205 reply_id: 17543


[TOPIC: post.html]
#10

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

Okay it opened a word like document??
and says process completed at the end of it??
uid: 19141 topic_id: 5205 reply_id: 17544


[TOPIC: post.html]
#11

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

I did, but it says on the terminator
ERROR: Could not find "Corona Simulator.app" in: /Applications/Corona.243
logout
uid: 19141 topic_id: 5205 reply_id: 17548


[TOPIC: post.html]
#12

IgnacioIturra

[GLOBAL: userInfoPane.html]
IgnacioIturra
  • Contributor

  • 359 posts
  • Guests

Yes. The icon is a black screen with >_ on it.

Now load your main.lua again in the simulator and you should see "Hello World" displayed in the terminal window.

Edit: Wait I got mixed up. The hello world you're doing will output to the screen. Are you sure you're opening up the right main.lua?

In the simulator go to file, open and the you have to find the folder where you saved the main.lua

If it doesn't work then check what the terminal says.

uid: 10835 topic_id: 5205 reply_id: 17547


[TOPIC: post.html]
#13

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

this is what the whole thing says :

Last login: Thu Jan 20 11:13:33 on console
/Applications/Corona.243/Corona\ Terminal ; exit;
admin-admins-Mac-mini:~ Mac2$ /Applications/Corona.243/Corona\ Terminal ; exit;
ERROR: Could not find "Corona Simulator.app" in: /Applications/Corona.243
logout

[Process completed]

uid: 19141 topic_id: 5205 reply_id: 17550


[TOPIC: post.html]
#14

IgnacioIturra

[GLOBAL: userInfoPane.html]
IgnacioIturra
  • Contributor

  • 359 posts
  • Guests

That means for some reason the simulator is not in the correct folder. Did you by any chance move it somewhere else? Reinstalling Corona would probably fix that.
uid: 10835 topic_id: 5205 reply_id: 17551


[TOPIC: post.html]
#15

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

okay ill reinstall it... then i will get back to you..
uid: 19141 topic_id: 5205 reply_id: 17552


[TOPIC: post.html]
#16

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

OKAY! i think its fixed, now it says:
Last login: Thu Jan 20 12:48:59 on ttys000
admin-admins-Mac-mini:~ Mac2$ /Applications/Corona.243/Corona\ Terminal ; exit;
uid: 19141 topic_id: 5205 reply_id: 17553


[TOPIC: post.html]
#17

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

Now when i open it in my simulator, the terminal says:

Last login: Thu Jan 20 12:48:59 on ttys000
admin-admins-Mac-mini:~ Mac2$ /Applications/Corona.243/Corona\ Terminal ; exit;

Copyright © 2009-2010 A n s c a , I n c .
Version: 2.0.0
Build: 2010.243
The file sandbox for this project is located at the following folder:
(/Users/adminadmin/Library/Application Support/Corona Simulator/TEST-CAFFD9E75DAA83643743D829EC6538A7)
Syntax error: /Users/adminadmin/Desktop/TEST/main.lua:1: unexpected symbol near '?'

The code i wrote on my main.lua was:
Local text = display.newText(“ Hello World!” , 50,50,nil, 26)
text:setTextColor(255,255,255)

what does it mean unexpected symbol near "?"


uid: 19141 topic_id: 5205 reply_id: 17555


[TOPIC: post.html]
#18

IgnacioIturra

[GLOBAL: userInfoPane.html]
IgnacioIturra
  • Contributor

  • 359 posts
  • Guests

Lua is case sensitive. Just copy/paste the text in the hello world sample to see if it works.

For example Local, should be local.

Also what program are you using to create the code? You shouldn't use something like Word since it adds formatting stuff that will break you code. In the new users sections of the docs there are some good recommendations for text editors.
uid: 10835 topic_id: 5205 reply_id: 17557


[TOPIC: post.html]
#19

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

Okay.
and yes i am using word... i think ill try text edit, or download text wrangler
uid: 19141 topic_id: 5205 reply_id: 17558


[TOPIC: post.html]
#20

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

THANKYOU SO MUCH!!!
Everything it working now and i am thrilled!!!
One more question...
How in the world do you know what codes to use if you wanna put in a background or make a background fit the whole screen??
is there a list of codes i can print out to have with me??
uid: 19141 topic_id: 5205 reply_id: 17560


[TOPIC: post.html]
#21

IgnacioIturra

[GLOBAL: userInfoPane.html]
IgnacioIturra
  • Contributor

  • 359 posts
  • Guests

The "list of codes" is the API in resources, though I'd advice against starting there.

First thoroughly read the new users start here docs until you understand what's going on. Also work your way through the beginner samples. Run them in the simulator, see what they do, and they open up the main.lua files to see how they're coded. Some are well commented explaining exactly what's going on at each line of code. I think it's the best way to learn.

Only after you have a decent grasp of the basics, start doing your own stuff.
uid: 10835 topic_id: 5205 reply_id: 17583


[TOPIC: post.html]
#22

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

okay. I went through all the example.. now im trying my own thing...

here is the code i have so far... just a image... it doesnt fit the screen though... what should i do?

My code so far:

myImage = display.newImage( "background-16.jpg" )
uid: 19141 topic_id: 5205 reply_id: 17599


[TOPIC: post.html]
#23

jhocking

[GLOBAL: userInfoPane.html]
jhocking
  • Corona Geek

  • 1,223 posts
  • Guests

I went through all the example

Nothing personal, but I don't believe you. There is no way you could have gone through all the new user docs and samples and still not know how the newImage() command works.

I like helping people, I really do; look at the answers I provide people who post in the newcomers forum. But when I see someone so obviously not paying any attention to the literally reams of help documentation provided here, by both Ansca and by users, I get a little steamed.
uid: 12108 topic_id: 5205 reply_id: 17617


[TOPIC: post.html]
#24

Madeline

[GLOBAL: userInfoPane.html]
Madeline
  • Observer

  • 27 posts
  • Guests

jhocking, your right, i didnt go thru them all.. i skipped a bunch, not on purpose though!!
I cant figure out how to change a pictures size!! I keep looking through all the tutorials, but just cant get to the right one!
uid: 19141 topic_id: 5205 reply_id: 17664


[TOPIC: post.html]
#25

jhocking

[GLOBAL: userInfoPane.html]
jhocking
  • Corona Geek

  • 1,223 posts
  • Guests

Edit your images in Photoshop, not in Corona.
uid: 12108 topic_id: 5205 reply_id: 17678



[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]