#342
Posted 13 October 2015 - 03:13 PM
#343
Posted 13 October 2015 - 03:15 PM
#344
Posted 13 October 2015 - 03:20 PM
local event, b = os.pullEvent("key", "char")
For specific events only. Also,
local keyboard = device.get("keyboard")
...
if keyboard.getKey(keys.up) then
-- go up
elseif keyboard.getKey(keys.down) then
-- go down
elseif ...
Edited by MKlegoman357, 13 October 2015 - 03:23 PM.
#345
Posted 13 October 2015 - 03:28 PM
Also, will we have the same fs api?
#346
Posted 13 October 2015 - 03:36 PM
local gpu = device.get("gpu")
local keyboard = device.get("keyboard")
local speaker = device.get("speaker")
gpu has different functions for maps and images and it can (or must) draw to an image:
gpu.setTarget(window.getImage())
Looks like the 'window' API has replaced the 'term' API.
local screenWidth, screenHeight = window.getSize() window.setFullscreen(true/false) --# (?) hides/shows the top bar (multishell tabs)
Speaker (unconfirmed documentation):
speaker.play(parameters : table, channel : number)
parameters = {
volume : number;
attack : number;
sustain : number;
decay : number;
frequency : number;
frequencySlide : number;
frequencyAccel/frequencyAcceleration : number;
vibratoDepth : number;
vibratoFrequency : number;
}
The speaker probably has different set of channels and you can only play one sound on one channel at a time, but this is only speculation.
More info might be coming later..
Creator, on 13 October 2015 - 03:28 PM, said:
Probably, but it will use the more Lua OOP standard way:
CraftOS 2.0: file:close() CraftOS 1.x: file.close()
#347
Posted 13 October 2015 - 03:52 PM
gpu.setColorMapping(colors.white, colors.blue)
And it will probably (?) make so that when you write the color white it will be displayed as blue. Also, you can reset the color right after you draw the changes:
gpu.resetColorMapping(colors.white)
There's also text writing capabilities:
gpu.drawText(x : number, y : number, text : string) ... gpu.drawText(0, 0, "Hello World!") --# writes 'Hello World!' on the top-left corner of the screen.
You can also set a global image offset:
gpu.setOffset(offsetX : number, offsetY : number)
which will simply "move" the resulting image by as much as you specify. Default is x=0 and y=0, which is "no offset".
#348
Posted 13 October 2015 - 04:02 PM
#350
Posted 14 October 2015 - 01:31 AM
MKlegoman357, on 13 October 2015 - 03:36 PM, said:
Not sure I can see the point of having fs.open()'s handles work like that, given that they'd then be the same as io.open()'s handles.
MKlegoman357, on 13 October 2015 - 03:52 PM, said:
gpu.setColorMapping(colors.white, colors.blue)
And it will probably (?) make so that when you write the color white it will be displayed as blue. Also, you can reset the color right after you draw the changes:
gpu.resetColorMapping(colors.white)
Assuming it is related to Dan's palette-altering video, you probably wouldn't want to reset "right after": doing so would revert pixels already on-screen, removing the point of remapping in the first place.
(If you don't get what I mean, watch the lower left corner of the video while he tweaks the sliders.)
#351
Posted 14 October 2015 - 04:38 AM
Bomb Bloke, on 14 October 2015 - 01:31 AM, said:
(If you don't get what I mean, watch the lower left corner of the video while he tweaks the sliders.)
That's the interestig part. The functions I showed were called almost at the same time. The colors were remapped, text was drawn and the colors were reset right after.
#352
Posted 14 October 2015 - 04:50 AM
#353
Posted 14 October 2015 - 05:43 AM
let's center something.
txt = "Hello World!" w,h = window.getSize() --or term? window.setCursorPos((w/2)-((#txt*8)/2)) write(txt)shouldn't be that hard...
#354
Posted 14 October 2015 - 09:53 AM
https://twitter.com/...071645708120065
@DanTwoHundread, on 14 October 2015 - 09:49 AM, said:
#355
Posted 14 October 2015 - 10:52 AM
Wait_, on 14 October 2015 - 09:53 AM, said:
https://twitter.com/...071645708120065
@DanTwoHundread, on 14 October 2015 - 09:49 AM, said:
Finally I can write texts in Bulgarian. That will be so useful with the large Bulgarian audience on the forums.
#356
Posted 14 October 2015 - 12:30 PM
Wait_, on 14 October 2015 - 05:43 AM, said:
let's center something.
txt = "Hello World!" w,h = window.getSize() --or term? window.setCursorPos((w/2)-((#txt*8)/2)) write(txt)shouldn't be that hard...
EDIT: and we could get the size of the font easily.
Edited by LeDark Lua, 14 October 2015 - 12:49 PM.
#357
Posted 14 October 2015 - 07:18 PM
https://twitter.com/...370715660099588

Also zoom buttons (or tab management) in the top right?
So what would hex editors be used for?
Edited by CraftedCart, 14 October 2015 - 07:19 PM.
#358
Posted 14 October 2015 - 07:19 PM
CraftedCart, on 14 October 2015 - 07:18 PM, said:
https://twitter.com/...370715660099588

Also zoom buttons in the top right?
So what would hex editors be used for?
Hopefully this also means that the binary bug has been fixed.
#359
Posted 14 October 2015 - 07:29 PM
image format=1 width=13 height=12
2
2
22222
2ff2ff2
2fffffff2
2 2ff0f0ff2 2
2222fffff2222
2222222222222
2 21ff7ff12 2
22ff7ff22
2 2ff7ff2 2
22222
EDIT: here's what it produces with paintutils in CC 1.74:
Edited by MKlegoman357, 14 October 2015 - 07:34 PM.
#360
Posted 14 October 2015 - 08:42 PM
"Ok, focus for the time being is back to @redirectiongame. Finances are such that I can't have two projects in development limbo at a time!"
#361
Posted 14 October 2015 - 08:49 PM
oeed, on 14 October 2015 - 08:42 PM, said:
"Ok, focus for the time being is back to @redirectiongame. Finances are such that I can't have two projects in development limbo at a time!"
I have been waiting to ask this question... why does redirection cost money? If we can play it for free on CC?
Edited by ArchTyler, 14 October 2015 - 08:54 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











