Jump to content




Touchscreen Monitors


20 replies to this topic

#1 Pinkishu

  • Members
  • 484 posts

Posted 19 July 2012 - 11:06 AM

Hi there,

yeah so basically just make it so when a monitor is punched it queues a event with where it was punched (probably which row/column in characters)

#2 ardera

  • Members
  • 503 posts
  • LocationGermany

Posted 19 July 2012 - 11:20 AM

I think its a great idea!

#3 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 19 July 2012 - 12:04 PM

Maybe even differing left and right clicks.

#4 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 19 July 2012 - 02:24 PM

Not sure if it would be possible to detect the row and column in characters, maybe wich monitor block.

#5 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 19 July 2012 - 02:40 PM

Well you could get the the yaw and pitch of the player, his position and the coords of the block clicked on. You could make your own raytracking with that and could then calculate the row and collom in chars.

#6 KingMachine

  • Members
  • 122 posts

Posted 19 July 2012 - 04:28 PM

View Postxuma202, on 19 July 2012 - 02:40 PM, said:

Well you could get the the yaw and pitch of the player, his position and the coords of the block clicked on.
Are you aware of how tedious that is?

#7 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 19 July 2012 - 05:01 PM

Well it's possible. I don't want to do this in lua at all if that's what you meant. But I know that the method that get's called when the block is clicked doesn't give information about where the block got clicked. You would only have to this once in the java code of the monitor.

#8 KingMachine

  • Members
  • 122 posts

Posted 19 July 2012 - 05:14 PM

I don't mean to be a negative nancy, in fact I'm attempting to be a positive paul now;
This is a very large undertaking as a feature in the manner that you've suggested xuma. This would best be offered as it's own suggestion on the forum. It is no small feat and minimizing it as "'only' 'having' to do it once' does the idea a disservice. It is a good idea, I'm just trying to bring into realistic perspective that it's a time consuming task in both code and flow-charting(plotting out the logic).

#9 G3R4RD

  • Members
  • 25 posts

Posted 19 July 2012 - 05:32 PM

Dan didn't wanted the mouse in ComputerCraft, So I think also not Touchscreen.

#10 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 19 July 2012 - 05:47 PM

It still seems as you've not completely understood my intention so I'll give a better explanation now.

I've suggested nothing at all. I've just give an idea of how this, finding out on which char of of the monitor the user has clicked, could be internally realized.

My initial post was an answer to what MysticT said

Quote

Not sure if it would be possible to detect the row and column in characters, maybe wich monitor block.

As far as I know there is no way to get information about where on a block the user clicked, in minecraft. So I was thinking about a way to get this information and one way for me since I've already made my own experiences in Game development seemed ray-tracking the click.

Maybe you can do this in another faster or simpler way but I only wanted to show that it is at least possible.

Back to your worries about the complexity of this solution: You would have to sit down for 1/2 an hour maybe and think of a way expressing this in mathematical terms but this is programming. I promise it's really not that hard if you have a basic understanding of the rate of Pythagoras, circular functions and/or matrix multiplication. I know what I'm talking about. :P/>



View PostG3R4RD, on 19 July 2012 - 05:32 PM, said:

Dan didn't wanted the mouse in ComputerCraft, So I think also not Touchscreen.

Ok. Maybe someone makes a peripheral.

If not I will at least try it, but since I don't have access to the CC code and don't want to re-code the CC Monitor I'll probably only make something like a touch pen. We'll see.

#11 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 19 July 2012 - 08:26 PM

Ok I've found out that creating a peripheral for purpuse is almost impossible, without access to the CC source

#12 Pinkishu

  • Members
  • 484 posts

Posted 20 July 2012 - 06:58 PM

Well MC already seems to know where you point :)/> So it has some kind of function for that :o/>

Just looked it up

Posted Image


hitVec looks like what coul dbe used for that?

#13 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 20 July 2012 - 08:47 PM

View PostPinkishu, on 20 July 2012 - 06:58 PM, said:

Well MC already seems to know where you point :)/> So it has some kind of function for that :o/>

Just looked it up

Posted Image


hitVec looks like what coul dbe used for that?

Great! That's what I need. Only problem will be compatibly with ARP since i can't guess the coords of the monitor based on the on side it's attached to anymore. But I've already got an idea for that.

#14 Pinkishu

  • Members
  • 484 posts

Posted 20 July 2012 - 10:33 PM

Well i don't see how it would work as a peripheral unless you remake teh whole monitor peripheral

#15 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 21 July 2012 - 09:22 AM

A Touch Pen. It's an item and when you use it I test if the clicked Block was a Monitor.

I only had to "hack" CC to find out how I can get information about orientation, size, and the position of the block in the quad of Monitors (Monitor is 5x3 blocks and you've clicked on the top-left (block) monitor).
I'll not redistribute/reuse any of the Computercrafts code. I just catch the NBT Tag Compound that get's written by the TileEntity. And read out the needed information from that.

I can now test every known Monitor peripheral (Only the ones directly attached to a Computer) if they are within the Rectangle of Monitors (Monitor is nXm blocks) the clicked Monitor is part of.

Now I have an IComputeraccess for all Computers connected to the Monitor. So I can queue an Event for them.

To know the Monitors attached to a Computer, the user will have to call ,only as often as the Monitor get's wrapped again, a function of my Peripheral the "Pen Dock" telling it also only the side of the Monitor.

If the Monitor is attached to a Peripheral Cable (ARP) the user has to give the coordinates of the Monitor Block directly connected to the Cable since I can't guess them anymore.

I hope you can understand what I mean. My English is not perfect and these sentences are way too complicated. :)/>

#16 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 21 July 2012 - 11:56 AM

Make a peripheral...
It should be added (IMO).

EDIT: 300'th POST!

#17 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 21 July 2012 - 12:19 PM

Already working on it. And till now I'm sure it'll work.
Seems like there will be no peripheral Cable compability since I would have to let the user tell me the Coordinates and because I can't verify whether the Monitor is truely connected to the Computer the Peripheral could be easily tricked.

#18 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 21 July 2012 - 09:01 PM

STATUS update: Almost finished only need to make some textures and a Lua API.

#19 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 21 July 2012 - 11:23 PM

Ok NOW I've encountered a huge Problem.
I'm done! Only thing is mapping the hit Position on Block to the Characters.

#20 xuma202

  • Members
  • 288 posts
  • LocationBonn Germany

Posted 22 July 2012 - 12:49 PM

Ok I've now released. It'll not give you the Row and Column since that would be very very complicated. At least you can test if the hit is in a predefined square on your own. :)/> link





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users