Jump to content




[API] Mouse and graphic api V1.6.1 beta. Easy to use GUI API with full mouse support

api utility media

  • You cannot reply to this topic
108 replies to this topic

#41 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 14 December 2012 - 09:35 AM

View PostOct125, on 14 December 2012 - 09:25 AM, said:


Thanks ArchAngel075!!
I'm programming in the right way now, but i'm having problems... And, one solution would be to create a function that clears the buffer without drawing it... So there is the suggestion :P/>
I also thougt of that (not sure for thougt) and you can easily do
gui.render(true)
gui.clear()
It will clear the buffer then clear the screen immediately. Or you can do
runButton = {}
runHeader = {}
coordButton = {}
I think the first is best because it will work even if I make it local :)
Edit : I fixed the bug with buttons coord, thanks to Oct125

#42 Oct125

  • Members
  • 49 posts

Posted 14 December 2012 - 09:51 AM

Updating to the beta version and testing... :P

Well the bug has fixed :) But... Pleeease add a function to clear only the buffers!! I don't want to make this by my self, because, i will redistribute my program with my version of your API!! The function: gui.render(true) clears the screen, so don't serves me, and i need to clear the buffers! If you have any other idea, please, disconsider this and tell me!

#43 ArchAngel075

  • Members
  • 149 posts

Posted 14 December 2012 - 03:02 PM

Going to write that round button part, dont think it of a circle, think it of a set of squares in a shape that just *happens* to be circular :P

im going to try and add alot of functionality to it, including position on screen, inner color, outline color, the size, text of button

One problem will be storing the data, since i am used to string storage (ie SIZE.."#"..Color1.."#"..Color2 ..... etc) this may be problematic...

Also i need this round button for my program thus it was going to be written anyways :)

#44 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 14 December 2012 - 07:01 PM

View PostOct125, on 14 December 2012 - 09:51 AM, said:

Updating to the beta version and testing... :P/>/>

Well the bug has fixed :)/>/> But... Pleeease add a function to clear only the buffers!! I don't want to make this by my self, because, i will redistribute my program with my version of your API!! The function: gui.render(true) clears the screen, so don't serves me, and i need to clear the buffers! If you have any other idea, please, disconsider this and tell me!
Ok I will add, it's really easy :P I will do that tonight because now, I have school so you have to wait a bit but to start implement this function, his name will be clearBuffer() :) Never mind, added in the beta :)

#45 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 14 December 2012 - 07:04 PM

View PostArchAngel075, on 14 December 2012 - 03:02 PM, said:

Going to write that round button part, dont think it of a circle, think it of a set of squares in a shape that just *happens* to be circular :P/>

im going to try and add alot of functionality to it, including position on screen, inner color, outline color, the size, text of button

One problem will be storing the data, since i am used to string storage (ie SIZE.."#"..Color1.."#"..Color2 ..... etc) this may be problematic...

Also i need this round button for my program thus it was going to be written anyways :)/>
Ok so go for it, I want to see the result :P If it is not so ugly I will maybe add it. Thanks you for all your ideas anyways :)

#46 ArchAngel075

  • Members
  • 149 posts

Posted 15 December 2012 - 02:07 AM

i want to point out the circles are imposible, they need to be HUGE to actually look like circles and the smallest word like HELLO will require a large circle...the pixels are not cut out for this...

*depressed face*

On to the page thing....

#47 Oct125

  • Members
  • 49 posts

Posted 15 December 2012 - 02:46 AM

View Postbjornir90, on 14 December 2012 - 07:01 PM, said:

View PostOct125, on 14 December 2012 - 09:51 AM, said:

Updating to the beta version and testing... :P/>/>

Well the bug has fixed :)/>/> But... Pleeease add a function to clear only the buffers!! I don't want to make this by my self, because, i will redistribute my program with my version of your API!! The function: gui.render(true) clears the screen, so don't serves me, and i need to clear the buffers! If you have any other idea, please, disconsider this and tell me!
Ok I will add, it's really easy :P I will do that tonight because now, I have school so you have to wait a bit but to start implement this function, his name will be clearBuffer() :) Never mind, added in the beta :)


Thanks!!! :lol:

#48 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 15 December 2012 - 04:58 AM

View PostArchAngel075, on 15 December 2012 - 02:07 AM, said:

i want to point out the circles are imposible, they need to be HUGE to actually look like circles and the smallest word like HELLO will require a large circle...the pixels are not cut out for this...

*depressed face*

On to the page thing....
That's why I didn't implement it :P

#49 Oct125

  • Members
  • 49 posts

Posted 19 December 2012 - 12:58 PM

I found a problem in the Beta API: "gui: 48 : Attempt to get length of number"

#50 ArchAngel075

  • Members
  • 149 posts

Posted 19 December 2012 - 03:35 PM

Im looking into that error now, also ill now be testing every beta and n-beta every release.

Also im going to look into improvements i can make here and there...

One i noticed is those checks like

if tostring(clears) == true then
term.clear()
end

eg on line 35 -> 37

can be perhaps improved for others by making it instead

if tostring(clears) == nil then
clears == false
elseif tostring(clears) == true then
---
---
end

this can maybe add speed to programmers and clean up abit, since you can now use a nil (no argument given) and it will default to false.

im not sure if this is really needed though :)


please look into the non-betas render() and setButton() functions, for some reason if the render's argument is true or "true" then the buttons dont seem to work, my guess is some how they are clearing the buffer and thus loosing the buttons information... I have confirmed its only when the clearBuffer() function is called does this happen.

lines 126 --> 139 are the render() function
lines 147 --> 155 are the setButton() function

It must be noted that this seems to happen when a button settup in a program is put in a while loop, ie

1.| while true do
2.| setButton---
3.| setButton---
4.| setButton---
5.| render(true)
6.| selection = gui.getSelection()
7.| ---whatever is executed ->
8.| ---based on selection
9.| end

i have a working button setup above without a loop and it works fine.

#51 ArchAngel075

  • Members
  • 149 posts

Posted 19 December 2012 - 03:49 PM

bug report and fix for :
lines 34 -> 37

function : setButton

highlited errors :
(errors = red, other noted lines = blue)
----
34.| function setButton(x, y, text, colorLine, color, clear)
35.| if tostring(clear) == "true" then
36.| clear()
37.| end
----
Error returned :
Line 36 : attempt to call boolean
----
Fix : (changes = green, other noted = blue)

34.| function setButton(x, y, text, colorLine, color, clears)
35.| if tostring(clears) == "true" then
36.| clear()
37.| end

Changed the arguments to "clears" instead of "clear" so that it wont call the argument but instead call the term.clear() function.

---
If this style of bug reports is annoying ill tone it down, but this gives me the best way of presenting the errors and fixes(if found)

#52 ArchAngel075

  • Members
  • 149 posts

Posted 19 December 2012 - 04:54 PM

View PostOct125, on 19 December 2012 - 12:58 PM, said:

I found a problem in the Beta API: "gui: 48 : Attempt to get length of number"

fix for line 48 Beta version, changes are in red

local sizeText = #text

to -->

local sizeText = #tostring(text)

#53 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 19 December 2012 - 07:06 PM

View PostArchAngel075, on 19 December 2012 - 03:35 PM, said:

Im looking into that error now, also ill now be testing every beta and n-beta every release.

Also im going to look into improvements i can make here and there...

One i noticed is those checks like

if tostring(clears) == true then
term.clear()
end

eg on line 35 -> 37

can be perhaps improved for others by making it instead

if tostring(clears) == nil then
clears == false
elseif tostring(clears) == true then
---
---
end

this can maybe add speed to programmers and clean up abit, since you can now use a nil (no argument given) and it will default to false.

im not sure if this is really needed though :)/>


please look into the non-betas render() and setButton() functions, for some reason if the render's argument is true or "true" then the buttons dont seem to work, my guess is some how they are clearing the buffer and thus loosing the buttons information... I have confirmed its only when the clearBuffer() function is called does this happen.

lines 126 --> 139 are the render() function
lines 147 --> 155 are the setButton() function

It must be noted that this seems to happen when a button settup in a program is put in a while loop, ie

1.| while true do
2.| setButton---
3.| setButton---
4.| setButton---
5.| render(true)
6.| selection = gui.getSelection()
7.| ---whatever is executed ->
8.| ---based on selection
9.| end

i have a working button setup above without a loop and it works fine.
That's because the clearBuffer() wich is used in render(true) clear also the data for getSelection(), you need to clear the buffer after the getSelection() :)

#54 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 19 December 2012 - 07:09 PM

View PostArchAngel075, on 19 December 2012 - 04:54 PM, said:

View PostOct125, on 19 December 2012 - 12:58 PM, said:

I found a problem in the Beta API: "gui: 48 : Attempt to get length of number"

fix for line 48 Beta version, changes are in red

local sizeText = #text

to -->

local sizeText = #tostring(text)
I will add a check to know if it is a number or not :) Also thanks you alot for your bug report it will help me a lot :) Expect a new version today !
Ps : thanks you for testing the bĂȘta !

#55 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 19 December 2012 - 07:19 PM

Fixed the clear bug in beta ! I will change the way the buffer work after school :)

#56 Oct125

  • Members
  • 49 posts

Posted 21 December 2012 - 04:22 AM

I'm testing the beta, and the code still buggy in line 48/51

#57 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 21 December 2012 - 06:59 PM

Oh sorry ! I forgot to upload the fix :(

#58 Oct125

  • Members
  • 49 posts

Posted 22 December 2012 - 02:28 PM

View Postbjornir90, on 21 December 2012 - 06:59 PM, said:

Oh sorry ! I forgot to upload the fix :(
That's ok ;)
But I still have problems on line 54...

#59 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 22 December 2012 - 07:02 PM

Fixed AND uploaded ;) I removed the useless if statement. Oh and I almost forgot : now the buttons on the pop-up should work :)

#60 Oct125

  • Members
  • 49 posts

Posted 23 December 2012 - 04:00 AM

View Postbjornir90, on 22 December 2012 - 07:02 PM, said:

Fixed AND uploaded ;) I removed the useless if statement. Oh and I almost forgot : now the buttons on the pop-up should work :)
Ok!

The code keeps buggy on line 122: "Expected Number"
I get this if i set a button, and use the render function!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users