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

#26 2012-06-19 11:43:54

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

Oh I see! Do you think you can work out a javascript drag-and-drop style system? I've never tried one! An elements pane is a good idea, and works well if we're dragging and dropping. One reason, though, why I had an elements list box, was so that if a user drags two elements on top of each other, they can still reach the one below to edit it.

I was initially thinking that the position of the element would be given as a coordinate as part of its properties in the properties window. Maybe dragging them around would be easier. (coordinates might still be useful for more specific things).

Last edited by sparks (2012-06-19 11:55:24)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#27 2012-06-19 12:00:15

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

I'm trying to work out what attributes different elements will need. Here's a start:

Background:
Canvas height
Canvas width
Background image/colour
.                         colour/gradient

Link:
link type:
no link
link
random link
.          link 1
.          link 2
.          etc
.          add link

Image
fit to size?:
.           height
.           width
Image URL
Image position
.           x pos
.           y pos

text
string
position
.          xpos
.          ypos
font-colour
font size

Okay, already I'm wondering how we want to deal with online/offline control.

Last edited by sparks (2012-06-19 12:03:37)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#28 2012-06-19 12:13:37

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

sparks wrote:

Oh I see! Do you think you can work out a javascript drag-and-drop style system? I've never tried one! An elements pane is a good idea, and works well if we're dragging and dropping. One reason, though, why I had an elements list box, was so that if a user drags two elements on top of each other, they can still reach the one below to edit it.

I was initially thinking that the position of the element would be given as a coordinate as part of its properties in the properties window. Maybe dragging them around would be easier. (coordinates might still be useful for more specific things).

I'm sure javascript D&D will be possible, and it will make it so much easier for the user. We can have a location setting in the element's properties, however, if you feel that's important! We can also redo the interface to add a list box for selection and use the canvas only for D&D rearranging. Less intuitive, more efficient.

Offline

 

#29 2012-06-19 12:15:10

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

sparks, if you don't mind, I'll post the list and you can edit it.

Background:
Canvas height
Canvas width
Background image/colour
.                         colour/gradient

Link:
link type:
no link
link
random link
.          link 1
.          link 2
.          etc
.          add link

Image
fit to size?:
.           height
.           width
Image URL
Image position
.           x pos
.           y pos

Text
string
position
.          xpos
.          ypos
font-colour
font size

Dynamic Text
Type: (list of pullable info)
User: The target user for the info (set to that user by default).
position
.        xpos
.        ypos
font-color
font-size
cut text if it exceeds [n] characters?

Dynamic Image
Type: (list of pullable info)
User: The target user for the info (set to that user by default).
position
.        xpos
.        ypos
Image URL
Resize?
.        width
.        height

Last edited by sparks (2012-06-19 13:00:58)

Offline

 

#30 2012-06-19 12:17:44

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

Perhaps clicking the GUI elements should still switch the properties window to them, and just have the elements list as a collapsed box that can be used in emergencies when the user can't reach the one they want to.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#31 2012-06-19 12:21:04

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

sparks wrote:

Perhaps clicking the GUI elements should still switch the properties window to them, and just have the elements list as a collapsed box that can be used in emergencies when the user can't reach the one they want to.

OK, I think that's definitely better.
Are we going to name the elements using <prefix><number>?

Offline

 

#32 2012-06-19 12:22:44

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

LS97 wrote:

OK, I think that's definitely better.
Are we going to name the elements using <prefix><number>?

I see that as being the easiest way. Perhaps text elements can be named as the first few characters of their string like in photoshop, but that's about it. Image elements could have a small thumb of their current image in front of their name too.

I added to the list, btw.

Last edited by sparks (2012-06-19 12:23:25)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#33 2012-06-19 12:29:22

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

sparks wrote:

I think we should draw up a list of the data we want to be able to pull from the site too. Should Dynamic Text elements be allowed to have custom text in it too, or should the user have to put normal Text elements to either side?

I think dynamic text should allow custom input only if it covers the whole text, being too difficult to implement otherwise. For example, one could specify text for online/offline sensor:

When online, display text "I'm here and ready to help!"
When offline, display text "I'm not online yet"
or something.

Last edited by LS97 (2012-06-19 12:30:42)

Offline

 

#34 2012-06-19 12:31:29

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

Oh I see.

Mockup time!

http://img254.imageshack.us/img254/1783/costume.gif

A little "T" icon by text, with the first few letters of the text as a name, a small icon of the image and an image icon by dynamic ones.

Possibly the icons should be a little larger than 10x10

Last edited by sparks (2012-06-19 12:33:03)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#35 2012-06-19 12:52:03

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

sparks wrote:

Oh I see.

Mockup time!

http://img254.imageshack.us/img254/1783/costume.gif

A little "T" icon by text, with the first few letters of the text as a name, a small icon of the image and an image icon by dynamic ones.

Possibly the icons should be a little larger than 10x10

I like those little icons. For text, have
"Text <check out my...>"
instead, maybe?

Offline

 

#36 2012-06-19 12:59:20

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

Okay, that sounds good!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#37 2012-06-19 13:01:04

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Scratch API 2.0

Ooh, this API thingy should also have utillities for forum manipulation, like a rainbow text generator or a click to enlarge image generator.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#38 2012-06-19 13:27:44

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

bobbybee wrote:

Ooh, this API thingy should also have utillities for forum manipulation, like a rainbow text generator or a click to enlarge image generator.

Ah, this wasn't really the direction I was aiming to go with this project for a plethora of reasons. Firstly, such forum manipulators already exist, secondly, I find rainbow text slightly annoying (personally) and thirdly, the Scratch Team and by extension the Community Moderators such as myself aren't keen on forum plugins because they mean that to effectively moderate the forums, we have to look at each page twice, once with the plugin and once without.

The nice thing about this API is that anyone with an image-enabled browser can see it, rather than it being a limited system that only those with an installed plugin can make use of.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#39 2012-06-19 13:57:51

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Scratch API 2.0

Not plugins, just BB generators. All centralized in the API for easier usage.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#40 2012-06-19 13:59:51

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

LS97, how good do you feel you are at graphics? I'm really not amazing so if you feel you have the perfect look for the site going then you're more than welcome to do that, otherwise I'm mediocre at best and can just come up with something and hope it looks okay!

I develop websites as a part-time job, and I did a few very early mockups for a go-karting company a while back for them to see what sort of things they wanted on their homepage. This is one of the ones they didn't choose, but perhaps some of the graphics in it could be recycled and used for this if need be. I still have all the elements used in the mockup.

http://img39.imageshack.us/img39/5480/screenshotofmockup.png
Click to enlarge.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#41 2012-06-19 14:40:59

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

The design looks really nice! I'd like to scratchify it a bit more by adding orange to the colour scheme and using the Scratch font for the logo.

I'm probably just as good as you at actually designing the website layout (I've done lots of it in the past), but I'm little to no good at making the graphics, so you go ahead  wink .

Last edited by LS97 (2012-06-19 14:41:05)

Offline

 

#42 2012-06-19 14:46:32

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

Alright, maybe we'll orangeify it a bit then


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#43 2012-06-19 14:54:24

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

So. There are about four stages to this the way I see it.

Firstly you reach the site. At this point the user should probably log in. Are we going with logins? It might be simpler to let people create their own accounts, though Scratch linking would have its benifits.

Once they have logged in they can either create a new image, or edit an image they have created already.

The next stage would be the creation/editing of the image. This will probably be the bit with the most work needed  tongue

Finally the user should choose whether their design is public or private, then click save and the image should be generated with a link to the image and a link for the link.

How are we transitioning between each stage? We could take the javascript route and have it all on one page, expanding and collapsing boxes as the user progresses through the stages, the HTML route with one section per page or some other way entirely. Thoughts?

Do you have any name ideas?


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#44 2012-06-19 15:37:27

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

I think you pretty much figured it out. We should begin by developing the features around the GUI editor first, and then move onto the core itself.

For transitions I think the best approach is traditional URLs; I hate single-addressed websites because I can never get easily to where I want to be!

Name: I have no idea.

Offline

 

#45 2012-06-19 16:46:14

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

LS97 wrote:

I think you pretty much figured it out. We should begin by developing the features around the GUI editor first, and then move onto the core itself.

I'm not sure what you mean by "features around the GUI editor" there...


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#46 2012-06-20 11:01:33

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

sparks wrote:

LS97 wrote:

I think you pretty much figured it out. We should begin by developing the features around the GUI editor first, and then move onto the core itself.

I'm not sure what you mean by "features around the GUI editor" there...

As a programming plan, instead of focusing first on the actual GUI (the core of the project), we should begin by making the user system, database, etc. and then move onto GUI and renderer. At least that's how I work.

It goes without saying that we need to plan it out first.

Offline

 

#47 2012-06-20 11:29:14

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

Oh of course! I suppose we've more or less covered the planning for the GUI now anyway, so discussing the actual system is a good next step. Certainly I'm expecting us to store the info for each image as a database value so maybe it would be worth working out how we're gonna do that. If we have unlimited or even just a high max of elements, I don't think a column for each element is going to work too well. I can think of three ways to do it off the top of my head.

We could store the entire image info for all elements in a single table using characters and numbers to represent settings, then decoding the value again to reconstruct the image. I worry this would be rather slow.

We could have a column for each element in the image, with all their properties stored as coded values that can be decoded upon building, again this may be slow.

Finally, and I think this might be the way to do it, is to have a row per element and a column for each property. an ID column can link all the elements of an image together, then we can do a "SELECT * FROM `database` WHERE 'ID'='$imageID'" to get all the elements back for the build. This would take up more database space, but might be faster for building.

I imagine layering elements is going to be a big problem. We'll have to make sure their z-index can be read back upon build, then draw the elements out from lowest to highest.

Last edited by sparks (2012-06-20 11:40:27)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#48 2012-06-20 12:15:30

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

Good thing to point out the z-index issue: it could happen that a user wants to overlay text to an image. We could store the z-index as part of each element's properties, but somehow I think the best way is adding a row with an ordered list of elements.

The third database structure proposal is indeed the best in my opinion.

database column names

id - the unique value
username - of the Scratcher
privacy - private or public
image ID - the number of the image the element belongs to
element ID - the number of the element belonging to the image
element type (e.g. dynamic image)

x position
y position
height
width
font-color
font-zide
URL - a link or image link

lookFor - if the element is interactive, what value is it looking for?
lookForUser - which user is the data being asked of
extraValue - for example, the images avaliable for a random image element could be listed here.

Last edited by sparks (2012-06-20 12:27:01)

Offline

 

#49 2012-06-20 12:27:08

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Scratch API 2.0

So, the database stores elements in rows, and the properties of the elements in columns. I've amended your post above to start off a list of element properties.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#50 2012-06-20 13:42:04

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

Do we really need username to be defined? Couldn't we have a general row at the beginning with the values?

Offline

 

Board footer