This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#301 2012-05-29 06:05:03

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: applejack-amcerbu-Hardmath123-collab

amcerbu wrote:

Yeah, sorry about that, applejack.  I don't know a thing about the Obj-C class library.

It's called Cocoa.  smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#302 2012-05-30 00:46:35

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: applejack-amcerbu-Hardmath123-collab

Hardmath123 wrote:

amcerbu wrote:

Yeah, sorry about that, applejack.  I don't know a thing about the Obj-C class library.

It's called Cocoa.  smile

Aha.  Hardmath123, you're probably the one to ask: is Obj-C considered higher- or lower-level (in terms of how close it is to machine language) compared to something like C# or Java?

Offline

 

#303 2012-05-30 17:09:36

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

Thanks, guys! I'm having a nice time, but I'm having a little trouble adjusting to the time zone. I really think that Japanese us much easier than French. We didn't take computers with us because we were afraid of them getting stolen, so I won' be able to try out some code. Hopefully, I'll be able to check this forum thread again, soon.  smile


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#304 2012-06-01 01:27:57

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: applejack-amcerbu-Hardmath123-collab

Wait... you're in Japan?  Nice!

Offline

 

#305 2012-06-01 16:41:58

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

No... I'm in France. The keyboard is really strange, so don't get upset at me if I accidentally type a q instead of an a. I was going to go to Japan later in the summer with my friend, but the timing didn't work out (extreme sadness). I do know Japanese, though. Rwar these keyboards are so annoying!!!

amcerbu wrote:

Wait... you're in Japan?  Nice!


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#306 2012-06-02 05:36:05

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: applejack-amcerbu-Hardmath123-collab

C'est tres bon!  Je n'ai pas un clavier francais, donc je ne peut pas mettre les accents sur les voyelles.  Desole pour mon mauvais francais!

Anyway, have a great time!  I remember now that you mentioned you would be going to France this summer.  You'll get used to typing on the keyboards after a few weeks (if I recall, the top left-hand corner of the keyboard is really scrambled).  Actually, I'm in Germany right now, right next-door.

Offline

 

#307 2012-06-02 09:23:27

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

I don't really know much French, just how to order food n' some other stuff. My sister had to translate what you said above  tongue . I would Scratch, but I'm not sure the hotel would like me downloading and "playing" on their computer. I'm actually getting better at typing on this keyboard much faster. I didn't know there were actually so many castles!  smile


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#308 2012-06-07 16:45:46

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

Only four more days! I'll get back on the 13th.  smile  I don't know how long it seems for you guys. I've gotten used to the French keyboard, but I think I'll be happy to get back to normal. Scratch on soon!


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#309 2012-06-07 19:39:24

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: applejack-amcerbu-Hardmath123-collab

Bon!  J'espere que vous avez appris un peu de Francais!

Offline

 

#310 2012-06-09 13:01:54

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

Merci!  smile


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#311 2012-06-12 17:57:04

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

Actually... I would like to know how to just put a picture in that UIView smaller than it, and keep it at normal resolution (no scaling), and move the picture around inside it so I can see whatever part of the picture I want. I've tried looking this up many times, but it's pretty confusing. There should probably be some simple sample code you can give me, so I can change variables and stuff for. I know how to fill a UIView with color, move it around and rotate it and stuff, but other stuff is more confusing. Thanks!

Hardmath123 wrote:

Hey Applejack, I'm pretty fluent in Obj-C, so I can help you out there! You can make it with only one UIView, and store the values in an NSMutableArray. Then you can draw the UIView by invoking the drawRect: command and iterating through the array. If you need more help. let me know.  smile

EDIT: Rereading your post, it looks like you're n=unfamiliar with Quartz 2D—that's the Mac/iOS drawing library native to Mac. Of course, the industry standard is OpenGL.


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#312 2012-06-14 13:29:27

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

I'm back now! - Yay! It's good to be able to Scratch, now.  smile


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#313 2012-06-15 12:37:34

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

Oh, I know! I can use a bunch of UIScrollViews, and just disable the finger interaction! (this was a bump-in-disguise)


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#314 2012-06-16 18:45:49

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

... It seems as though everyone has gone on vacation, now that's I'm gone. Anyway, I made some code. I'm sure it's full of mistakes but could you please help me with it? The Apple Developer Forums seem to be down.

Code:

int x;
int y;
int tileX;
int tileY;

for (tileY = 1; tileY <= 7; ++tileY) {
    
    for (tileX = 1; tileX <= 9; ++tileX) {
        
        CGRect scrollRect = CGRectMake(tileX * 60, tileY * 60, tileX * 60 + 60, tileY * 60 + 60);
        UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:scrollRect];
        scroll.contentSize = CGSizeMake(60, 60);
        scroll.canCancelContentTouches = NO;
        [scroll setContentOffset: GCPointMake(0, 0) animated: NO];
        scroll addSubView:ElasticTilesetReal.PNG
    }
    
}

Xcode wrote:

expected identifier or '(' before 'for'
expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
expected identifier or '(' before '++' token

Building the project fails... I'm very new to this stuff, and only know a limited number of things. Maybe even amcerbu may be able to figure out what's wrong, even though he doesn't know obj-C
Oh, and by the way, I could make my whole app in C++, if I wanted to (although I'm not that great at that, either).


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=square&amp;user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=text&amp;user=applejack

Offline

 

#315 2012-06-17 06:37:37

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: applejack-amcerbu-Hardmath123-collab

I have absolutely no idea why it threw those compiler errors.  I have only two suggestions:

1. Your for(;;) loops probably should initialize the variables to 0, and check if they are less than 9, not less than or equal to 9.  Also, you generally use i and j as variables in for loops (it's just a long-standing "tradition").

Code:

for (int i = 0; i < 9; ++i)
{
   for (int j = 0; j < 9; ++j)
   {
   }
}

The only other thing I could spot (although I'm probably wrong, since I don't know Obj-C): There's no semi-colon at the end of line 15

[scroll addSubView:ElasticTilesetReal.PNG]
Anyway, hopefully Hardmath will come to the rescue here.

Last edited by amcerbu (2012-06-20 16:50:32)

Offline

 

#316 2012-06-19 15:02:08

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

Thank you. There's supposed to be a semi-colon after j < 9. It still doesn't work. The Apple Developer Forums are being down or mean or something. I don't want to have to make a stack overflow account. I am hungry. GRAAAR. Sorry. I'm a little agrivated, but it's not your fault. Thanks for trying to help, I really appreciate it.  smile

Edit: And I saw your post as soon as you made it, I just didn't reply right away.

Last edited by applejack (2012-06-19 15:03:05)


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=square&amp;user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=text&amp;user=applejack

Offline

 

#317 2012-06-20 17:26:29

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: applejack-amcerbu-Hardmath123-collab

^^ Whoops, here I am making a semicolon error, after trying to correct what I thought was one of yours (I went in and edited the post).  I should really write my code in Visual Studio first and then paste it into the forum box afterwards...  Don't we all love IntelliSense. 

Another thing: Generally, in for loops, you declare the variables within the statement, not before. 

Code:

for(int i = 0; i < 10; ++i) { }

In that code, the integer i is declared at the start of the loop (int i = 0;).  The compiler might have complained that your variables were already defined when you entered the loop.  I've never actually tried to declare my variables outside of a for loop before, and in fact, you shouldn't have to.  Have you already learned about variables being "in scope"?  In C# (so it may not hold true in Obj-C), declaring a variable allocates space in memory, and once it goes "out of scope," the memory is released -- recycled -- back to the computer, to be used for other things.  A variable's scope refers to which set of curly braces it was defined inside.  A variable is always available in scopes further "in" (so, more indented, in effect).  However, variables created by a function (or in an if clause, for/while loop, etc.) won't be available outside the function.  Before the function, the variables don't exist, and after the function, the variables have already been released. 

(Fun fact: the Recycle Bin/Trash works the same way.  Deleting a file doesn't actually clear out the bytes on the hard drive where that file was stored, it just tells the computer that those locations are no longer important to hold onto, so they can be overwritten safely.  On Mac (I don't know about Windows) there's a way to clear out unused bytes so that "deleted" data can't be recovered.  So, if you have something extremely important that you've deleted, and you don't want any hackers to somehow fish it out of your computer, use that feature.)

Just looking at Obj-C syntax makes my eyes hurt.

Last edited by amcerbu (2012-06-20 17:27:29)

Offline

 

#318 2012-06-21 00:40:58

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

Thank you! that's so cool - I never knew that the variables dissapeared afterwards!  big_smile I feel much happier now. I shall try this tommorow, because it's very late and I was just doing a before-shut-down-check on scratch and stuffs.  smile

amcerbu wrote:

^^ Whoops, here I am making a semicolon error, after trying to correct what I thought was one of yours (I went in and edited the post).  I should really write my code in Visual Studio first and then paste it into the forum box afterwards...  Don't we all love IntelliSense. 

Another thing: Generally, in for loops, you declare the variables within the statement, not before. 

Code:

for(int i = 0; i < 10; ++i) { }

In that code, the integer i is declared at the start of the loop (int i = 0;).  The compiler might have complained that your variables were already defined when you entered the loop.  I've never actually tried to declare my variables outside of a for loop before, and in fact, you shouldn't have to.  Have you already learned about variables being "in scope"?  In C# (so it may not hold true in Obj-C), declaring a variable allocates space in memory, and once it goes "out of scope," the memory is released -- recycled -- back to the computer, to be used for other things.  A variable's scope refers to which set of curly braces it was defined inside.  A variable is always available in scopes further "in" (so, more indented, in effect).  However, variables created by a function (or in an if clause, for/while loop, etc.) won't be available outside the function.  Before the function, the variables don't exist, and after the function, the variables have already been released. 

(Fun fact: the Recycle Bin/Trash works the same way.  Deleting a file doesn't actually clear out the bytes on the hard drive where that file was stored, it just tells the computer that those locations are no longer important to hold onto, so they can be overwritten safely.  On Mac (I don't know about Windows) there's a way to clear out unused bytes so that "deleted" data can't be recovered.  So, if you have something extremely important that you've deleted, and you don't want any hackers to somehow fish it out of your computer, use that feature.)

Just looking at Obj-C syntax makes my eyes hurt.


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=square&amp;user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=text&amp;user=applejack

Offline

 

#319 2012-06-21 14:08:22

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

D: It still doesn't work. I shall try something else.


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=square&amp;user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=text&amp;user=applejack

Offline

 

#320 2012-06-24 19:22:08

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: applejack-amcerbu-Hardmath123-collab

Oh, well, I hope that helped at least a bit.

Offline

 

#321 2012-06-25 00:06:01

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

Yes, I think you did. I have decided to use the Cocos2D library to make everything happy. I don't have to give credit to Cocos2D if I don't want to. The thing is, I REALLY don't want to give it credit. But I think that if people worked hard making cocos2D, I should give them credit. I can give them a little splurb in the credits if I like. I kinda feel like I'm cheating by using Cocos2D... But hey, why should I be using random things like UIScrollViews to do something they're most definitley not meant for. You are really helping SO much though, amcerbu! I shall give thanks to you in the credits.  big_smile


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=square&amp;user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=text&amp;user=applejack

Offline

 

#322 2012-06-25 09:23:07

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: applejack-amcerbu-Hardmath123-collab

Sure, no problem!  I'm not sure whether you give credit to Cocos2D... I don't think you have to give credit to Microsoft for the .NET framework every time you write a C# application.

Offline

 

#323 2012-06-25 16:52:07

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

I don't have to give them credit, but it's appreciated. I just downloaded Cocos2D! Gosh it was so confusing, but I'm very happy to have accomplished it now. I had to do some stuff with Terminal (which I had never used before), and I had to try many times, but I did it! I'm so happy now! I shall make a small sample project to kinda learn the library.  smile


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=square&amp;user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=text&amp;user=applejack

Offline

 

#324 2012-06-26 19:06:48

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: applejack-amcerbu-Hardmath123-collab

Nice!  Please upload some screenshots!

Offline

 

#325 2012-06-27 23:45:32

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: applejack-amcerbu-Hardmath123-collab

Of the sample app from the online tutorial or of my app? I've been unable to finish the sample app because of suprise archery/lunch/game store/friend's car gets a flat tire in my driveway/my cat getting crushed by a giant wrecking ball/having dinner/swim team/swim meet/BLARG. I'm almost done with the sample app, and I think it's pretty cool. You can find the website for it here. I'm actually starting to understand how the language works, I think. So yay!

amcerbu wrote:

Nice!  Please upload some screenshots!


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=square&amp;user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=text&amp;user=applejack

Offline

 

Board footer