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

Drawing Api; Mouse Location And Laptop

Started by NeuroTesla, 28 February 2012 - 11:02 AM
NeuroTesla #1
Posted 28 February 2012 - 12:02 PM
I don't know how familiar you are with the rendering system in Minecraft,
But if you could, would it be possible to make some kind of drawing api:

Kind of like this:

Monitor:DrawBox(White, {x = 3, y = 5}, {x = 6, 10})

Monitor:DrawLine, DrawCircle, DrawTexture, DrawText

Mouse.GetLocation

You could maybe use the Java Blitting API then use Rendertotexture to store it or something.

Perhaps maybe a image class:


local Image = {}
function Image.Create(x,y)
 local t = {}
 setmetatable(t, self)
end
function Image.DrawCicle(x,y,color,radius)
end
function Image.DrawLine(x1,y1, x2,y2)
end


Which saves Bitmap storage within itself.
Then you can actually draw the Image on a monitor to use it as a GUI Window.


What would also be awesome if you integrated an laptop or some sort of portable computer which can connect to other computers wirelessly.
Kind of like an wireless transmitter/reciever, the laptop would be able to send/access information to the computers.

You could make it simular to a floopy disk where you only can connect to a single computer trough a block.
wilcomega #2
Posted 12 March 2012 - 04:56 PM
i think impossible because it would lag your server
passinglurker #3
Posted 12 March 2012 - 05:23 PM
this probably belongs in the suggestions forum
Sebra #4
Posted 12 March 2012 - 06:06 PM
1. To Suggestions.
2. ASCII only for performance reason AFAIK. But if you convince Dan200…
3. There is no mouse in MC. Are you waiting monitor will see where are you looking to?
4. Laptop/Notebook suggested already.
Liraal #5
Posted 12 March 2012 - 06:41 PM
To borrow the Sebra's post structure :mellow:/>/> :

1. These are ideas for peripherals (whenever the docs come out).
2. A PDA seems to be fairly similar to a regular terminal, so it can share most of its code and thus be not that hard to code.
Sebra #6
Posted 12 March 2012 - 07:09 PM
1. For now it seems monitor can return size only. Would Dan200 make it sensor with events of rightclick position?
2. To make Notebook able to look like map without GUI is not so easy IMHO. I hope it is doable.
Liraal #7
Posted 12 March 2012 - 07:14 PM
1. You have read the topic about key events. Still believe that dan will add mouse events? :mellow:/>/>
2. I didn't mean it like a map, more like a press-right-mouse-key-to-open computer.
Sebra #8
Posted 12 March 2012 - 07:21 PM
1.Have you seen monitor in action? It has no input! You almost unable to see it when console GUI open.
2. Almost the same reason here. To be able to "type on keyboard" while look around with mouse. If all, you want, is placeable comp, you can place/pick up current. And is is not hard to place it.
passinglurker #9
Posted 12 March 2012 - 07:24 PM
1. is it to late to join the list party?
2. Liraal you mean like the remote in the ccmagic peripheral?(it might have a mouse demo as well)EDIT: found the video but its tagged private
3. simple related idea add a touch screen peripheral where you right click the monitor block and the block generates a redstone signal then just wire it to your computer and code your gui accordingly.
Liraal #10
Posted 12 March 2012 - 07:31 PM
1. Sebra, there is supposed to be a wireless keyboard being prepared for monitors.
2. And i don't want a placeable terminal, I mean it more like hand-portable device. And so that it has a build-in modem and keeps its on/off status for as long as it's in the hotbar.
3. I don't know how does the remote look :mellow:/>/>
4. And the monitor should generate a rednet signal (wired or not) or call a peripheral event in the master computer.
Sebra #11
Posted 12 March 2012 - 07:41 PM
1.1.You are welcome.
1.2.Seen that remote, still GUI. Hide world from me when typing.
1.3.Console touch monitor, so no wire needed but API.
2.1.Never seen mentioned. How should it work?
2.2.Did you see my Notebook suggestion? Mostly the same, but ability to look around while typing would be great for many control programs.
2.3.As you describe PDA, console, bound to remote comp/turtle.
2.4.Yes.
Liraal #12
Posted 12 March 2012 - 07:46 PM
2.1. It's my idea for that, IMO the easiest to implement ('borrow' the terminal code and add some peripheral stuff :mellow:/>/> )
2.2. Unfortunately, in that case, no looking around.
2.3. Not a slave device, but a computer in its own right.