Author Topic: Jens' Script Editor - An on-calc lua editor  (Read 143826 times)

0 Members and 5 Guests are viewing this topic.

Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #105 on: August 25, 2013, 05:11:55 pm »
This Script Editor doesn't include any textures, the font and the menu is from the OS and everything else is generated with the graphic engine
Sorry for nonsense.

Projects:



Offline AnToX98

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 107
  • Rating: +10/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #106 on: August 26, 2013, 03:08:26 am »
Oh sorry I was talking about Minecraft 2D :P



My Lua projects :

Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #107 on: August 26, 2013, 02:11:04 pm »
I just started to work on version 2.0 and those are the features/changes I want to include:
- full console to see output of the print function
- User Skript runs on its own page to switch to the editor/console screen for debugging
- console runs on its own frame so that you can copy it and attach it to the running skript screen
- (as suggested by adriweb) an autocompletion popup
- (as suggested by AnToX98) a customizable "insert" function and customizable syntax colouring
- faster rendering (I'll have to do some research there, maybe if I'd use textures for letters or render them with gc:drawPolyLine(...))

Please tell me what you think of those features and feel free to make proposals if you have any suggestions for the new version!

PS: The development of this version 2.0 will be much slower! (school started again and I continued working on Minecraft 2D...)
« Last Edit: September 26, 2013, 04:06:47 pm by Jens_K »
Sorry for nonsense.

Projects:



Offline AnToX98

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 107
  • Rating: +10/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #108 on: August 26, 2013, 03:02:56 pm »
This is nice update but it would be cool to enable selecting with shift (like on computers) instead of ctrl+click :p



My Lua projects :

Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #109 on: August 27, 2013, 08:38:22 am »
Yes, that would be cool, but unfortunately it is not possible to detect the shift or ctrl key :-\ ctrl+click is an exception because it triggeres the "grab" function
Sorry for nonsense.

Projects:



Offline AnToX98

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 107
  • Rating: +10/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #110 on: August 30, 2013, 09:12:51 am »
It would be cool to be able to custom the "insert" function in the menu, it would be very helpful :)



My Lua projects :

Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #111 on: August 30, 2013, 10:41:26 am »
@AnToX98: Yeah, I had the same idea when I made that insert function, but I forgot it later, thank you very much for this suggestion, I'll add it to the list! :D
« Last Edit: August 30, 2013, 04:00:50 pm by Jens_K »
Sorry for nonsense.

Projects:



Offline AnToX98

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 107
  • Rating: +10/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #112 on: September 03, 2013, 03:25:35 am »
Two things :
- Is the physics engine running on this editor ?
- There's a bug when you "undo" just after inserting some stuff



My Lua projects :

Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #113 on: September 03, 2013, 09:52:06 am »
The physics engine should work on the apilevel2+ version and yes, there seems to be a bug at undoing an insertion, I'll fix that for v2.0 or maybe on an earlier version (possibly v1.0.1) thanks for the report!
Edit: I tested
Code: [Select]
require "color"
function on.paint(gc)
    gc:setColorRGB(color.red)
    gc:drawString("Red",10,30)
end
and it worked. That proves that loading libraries works!
« Last Edit: September 03, 2013, 10:28:11 am by Jens_K »
Sorry for nonsense.

Projects:



Offline AnToX98

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 107
  • Rating: +10/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #114 on: September 03, 2013, 10:20:53 am »
It's strange because when I tested, it don't worked... I'll check again :p

EDIT : This code works on TINSS but don't works on your editor :S. Is there an error on the code or a problem with your editor ?

Code: [Select]
platform.apilevel = "2.0"
require "physics"
timer.start(0.01)

function on.resize()
    W = platform.window:width()
    H = platform.window:height()
    space = physics.Space()
    newBody = physics.Body(100, 0)
    newBody:setVel(physics.Vect(1000,1000))
    space:addBody(newBody)
end

function on.paint(gc)
   
    local width = W/10
    local pos = newBody:pos()
    local vel = newBody:vel()
    local velX = vel:x()
    local velY = vel:y()
    local posX = pos:x()
    local posY = pos:y()
 
    if posX > W then
        velX = -1 * math.abs(velX)
        posX = W
    elseif posX < 0 then
        velX = math.abs(velX)
        posX = 0
    end
    if posY > H then
        velY = -1 * math.abs(velY)
        posY = H
    elseif posY < 0 then
        velY = math.abs(velY)
        posY = 0
    end

    newBody:setPos( physics.Vect(posX, posY) )
    newBody:setVel( physics.Vect(velX, velY) )
    gc:setColorRGB(0, 0, 255)
    gc:fillArc(posX, posY, width, width, 0, 360)
end

function on.timer()
    space:step(0.01)
    platform.window:invalidate()
end
« Last Edit: September 04, 2013, 05:17:04 am by AnToX98 »



My Lua projects :

Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #115 on: September 04, 2013, 09:48:25 am »
That's very strange, I copied the code and it works perfectly when I run it in my Editor. Mybe it's because of the line platform.apilevel = "2.0", that doesn't have any effect in the Editor because it's not on the first line on the whole program and it can cause errors if you do it anyways. Are you sure that you are using the file "Jens' Script Editor apilevel2+"? What error does it output?
Sorry for nonsense.

Projects:



Offline AnToX98

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 107
  • Rating: +10/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #116 on: September 05, 2013, 11:48:57 am »
Yeah sorry I made a mistake, now it works perfectly :)



My Lua projects :

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #117 on: September 05, 2013, 02:43:48 pm »
Thanks to this I'm able to do some coding on the daily bus ride to school and the manual page has proven to be immensely helpful :)
The word 'class' doesn't seem to be highlighted (pink) for me. I'm using the 3.1 version. I'm looking forward to the 2.0 version.

Some people need a high five in the face... with a chair.
~EC

Offline Jens_K

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 187
  • Rating: +52/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #118 on: September 05, 2013, 04:06:43 pm »
@ElementCoder: That's the purpose I made it for, I'm glad that it's useful for you :) And yes, class() is not highlighted yet, I forgot that because it was not listed under the basic functions... thanks for the report, I'll fix that for the next update!
« Last Edit: September 05, 2013, 04:07:17 pm by Jens_K »
Sorry for nonsense.

Projects:



Offline AnToX98

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 107
  • Rating: +10/-0
    • View Profile
Re: Jens' Script Editor - An on-calc lua editor
« Reply #119 on: September 06, 2013, 05:52:25 am »
I think the "repeat" loop is not highlighted to.



My Lua projects :