This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
HPWebcamAble's profile picture

Simple Screen Maker

Started by HPWebcamAble, 10 April 2015 - 12:14 AM
HPWebcamAble #1
Posted 10 April 2015 - 02:14 AM
My Screen API (Forum Post) is a nice tool, but it's very similar to the hundreds of other API's that create buttons for you


So I decided to give my API an interface!


Simple Screen Maker



Download:

pastebin get sw4PJVPK ssm

(Only works in an Advanced Computer)


Description:

This program lets you create Screens from my Screen API!

When you save your Screen, it makes a file that contains a each of your Objects/Click Areas in a function, ready to add to your program!
(Your program has to implement my Screen API to display the elements)

See the How to Use section below for more information


SpoilerThe main screen
[attachment=2227:Main Screen.JPG]

Create menu
[attachment=2226:Create….JPG]

A black Object with no text
[attachment=2225:A Black Object with no text.JPG]

Right click an Element to edit, or left click and drag to resize or move it
[attachment=2228:Right Click to edit, Drag to resize and move.JPG]

Spoiler|2.3|
-Better message when loading a file that uses the previous save format
-Checks to make sure you are using at least CC 1.74
-Fixed a bunch of typos
-Cleaned up the code
-Added a default of each element that can be modifed, new elements will use those properties
-Changed to key bindings that should be easily reached with only one hand
-Changed Edit Element screen
*Elements can be renamed now
-Most text boxes and titles should fit on pocket computers now
*Let me know if you find one that doesn't
-Updated how elements save their data to support my Screen API 2.0
*Cannot load saves from older versions

|2.2|
-Added state editing!
-Cleaned up the code
-More text shortened to fit on all screens
-Elements created with the program are compatible with my Screen API again (whoops)
*Cannot load saves from older versions

|2.1|
-Cleaned up the code
-Updated description
-Fixed buffer causing anything off the right of the screen to become invisible
*Heading text should show up on pocket computers
*Objects and click areas show up when they are off the right edge
-Shortened a lot of text, most should fit on pocket computers

|2.0|
-Changed a few key bindings
-Tweaked how elements are created
-You can now import paint file to use as the background for positioning elements relative to the image
-New save file format

|1.1|
-Cleaned up the code
-Changed Delete Element options to 'Delete' or 'Cancel'
-Fixed a few minor bugs


Coming 'Soon':
-Layers


How To Use:


Creating a Screen is easy!

1. Download the program
2. Draw and save your screen
3. Add my Screen API to your program (Get it here)
4. Add the functions that Simple Screen Maker created to your program

Hit h in the program to view a list of the controls

Bugs and Questions:

PROGRAMMING questions should go in the Ask-a-Pro forum
Just comment with any bugs or specific questions
Edited on 18 January 2016 - 06:53 PM
minebuild02 #2
Posted 16 April 2015 - 05:31 PM
Can I use this in an IDE?
HPWebcamAble #3
Posted 16 April 2015 - 11:48 PM
Can I use this in an IDE?

Yes, just be sure to give me credit for that part
Agent Silence #4
Posted 17 April 2015 - 02:42 AM
Can I use this in an IDE?

Yes, just be sure to give me credit for that part
Speaking of such, I was thinking about using it in Guide 2

If you don't know what Guide is, click here
HPWebcamAble #5
Posted 17 April 2015 - 03:18 AM
Speaking of such, I was thinking about using it in Guide 2

I can only guess that the IDE would give you the option to use my program to draw a menu

I have no idea how you would integrate this into your Guide program

It'll probably be ok, but what did you have in mind?


You guys ARE talking about the program itself, right? Not the code that it creates for you (Obviously you can use that)
HPWebcamAble #6
Posted 21 April 2015 - 02:42 AM
Update! Version 1.1

-Minor bug fixes, cleaned up code
Edited on 05 January 2016 - 03:09 AM
Xanomes #7
Posted 13 July 2015 - 02:54 PM
When I on server created file, then second file, ex.: screen:draw(name-of-first-file), then left the game and joined server, started my program, Craft OS said: "attempt to index ? (a nil value).

But without this, your program is nice and really helpfull… it wants only something for click event settings (when i toggle click on for object, then open settings what it will do when I will click the object).
ebernerd #8
Posted 17 July 2015 - 04:34 PM
I love this idea. If i were to make my own version of this that's like completely mine and completely unrelated to this but has a similar idea, would you still want credit, or no? Because it would be cool for a project i have in mind… ;)/>
HPWebcamAble #9
Posted 17 July 2015 - 07:39 PM
I love this idea. If i were to make my own version of this that's like completely mine and completely unrelated to this but has a similar idea, would you still want credit, or no? Because it would be cool for a project i have in mind… ;)/>

Glad you like it :)/>

Sure, you can make your own version, if its completely yours you don't have to give me credit, but if you really want to I won't complain.

I was actually working on Version 2 a while ago, but I had some problems with rendering (flickering), and I lost interest.
I might come back to it soon, we'll see.
Waitdev_ #10
Posted 20 July 2015 - 06:01 AM
looks cool :D/>
i might actually try it in making some programs
HPWebcamAble #11
Posted 20 July 2015 - 06:43 AM
looks cool :D/>
i might actually try it in making some programs

Hope it works for you!

If not, I'd suggest trying my Screen API on its own.
HPWebcamAble #12
Posted 04 January 2016 - 03:33 AM
Update! Version 2.0

-Changed a few key bindings
-Tweaked how elements are created
-You can now import a background to use for positioning
-New save file format
HPWebcamAble #13
Posted 05 January 2016 - 04:03 AM
Update! Version 2.1

-Cleaned up the code
-Updated description
-Fixed buffer causing anything off the right of the screen to become invisible
*Headings should show up on pocket computers
*Objects and click areas show up when they are off the right edge
-Shortned a lot of text, most should fit on pocket computers
dirtywastegash #14
Posted 12 January 2016 - 04:19 AM
Hi there. Firsty must say this looks awesome. I'm really hoping it will help me to create some better looking programs as formatting and such is definately not my strong point.
No such luck at the moment.

I downloaded the file from pastebin using the command supplied but when i run ssm i get an error.


ssm:201: attempt to call nil

line 201 reads
local curBack = term.getBackgroundColor()
HPWebcamAble #15
Posted 12 January 2016 - 05:34 AM

ssm:201: attempt to call nil

That means you are using an older version of ComputerCraft!

You'll need at least CC 1.74 to use this program. One day, I'll get the program to check for you…


You should be able to use CCEmuRedux (an emulator, which runs without minecraft) with this program, then use the code (With my Screen API) in an older version of CC.
Edited on 12 January 2016 - 11:09 PM
dirtywastegash #16
Posted 13 January 2016 - 03:10 PM
Wow. Thank you for such a prompt reply.
Its a problem i keep running in to. Unfortunately my machine doesnt like running modded MC at any version higher than 1.6.4 which is a damn shame seeing as there is so many cool new features in CC now.
Still I was not aware there was even a CC emulator available. that is going to make my life so much easier that keep uploading files to my server via FTP.
I'm running CC 1.6.3 so hopefully things will work out. I will post here to let you know the outcome :)/>
HPWebcamAble #17
Posted 14 January 2016 - 03:41 AM
Update! Version 2.2

-Added state editing!
-Cleaned up the code
-More text shortened to fit on all screens
-Elements created with the program are compatible with my Screen API again (whoops)
*Cannot load saves from older versions
Lupus590 #18
Posted 14 January 2016 - 11:26 AM
*Cannot load saves from older versions

suggestion, separate program to port saves
HPWebcamAble #19
Posted 15 January 2016 - 12:14 AM
suggestion, separate program to port saves

Takes about 3 seconds in a text editor:
In the save, find "colors" and replace it with "states" (no quotes)

If anyone has actually used the program and wants to port their save, this is all they have to do.
Sure, a little program would be pretty easy to write to do it, but … has anyone even used it yet? ;)/>
Lupus590 #20
Posted 15 January 2016 - 08:42 AM
if it's that simple then why not have a porter in the main program?
HPWebcamAble #21
Posted 15 January 2016 - 03:04 PM
if it's that simple then why not have a porter in the main program?

Hm, maybe. I'll see if I have time to put it in the next update.
Lemmmy #22
Posted 15 January 2016 - 04:49 PM
This is pretty neat! I thought I'd take the time to correct a few typos I found.


This should say Borders.


Selelected? Selected.


Can you make the spaces after the colons here consistent? Put a space after Name: and a space after Text: and States:

Perhaps you could also make it so when you click on an element then drag the corners, you can resize it?
Overall, the generator is pretty neat. Good work!
Edited on 15 January 2016 - 03:59 PM
HPWebcamAble #23
Posted 15 January 2016 - 11:45 PM
snip

Thanks for pointing those out! I write most of my code at around 11pm, while playing two other games and browsing reddit at the same time. Its a wonder the thing even compiles.
I'll get em in the next update

I did actually notice the spacing issue. I didn't fix it partially because I forgot about it, but also because I'm trying to work out a better way to display that information.
EG a new interface for the edit element screen.


Perhaps you could also make it so when you click on an element then drag the corners, you can resize it?

You can, kind of. The bottom right corner does that. Decided not to have every corner do it for… laziness mostly.
Edited on 15 January 2016 - 10:45 PM
HPWebcamAble #24
Posted 18 January 2016 - 07:52 PM
Update! Version 2.3

Spoiler-Better message when loading a file that uses the previous save format
-Checks to make sure you are using at least CC 1.74
-Fixed a bunch of typos
-Cleaned up the code
-Added a default of each element that can be modifed, new elements will use those properties
-Changed to key bindings that should be easily reached with only one hand
-Changed Edit Element screen
*Elements can be renamed now
-Most text boxes and titles should fit on pocket computers now
*Let me know if you find one that doesn't
-Updated how elements save their data to support my Screen API 2.0
*Cannot load saves from older versions