Search found 10 matches
- Sat Feb 11, 2017 6:13 pm
- Forum: Support and Development
- Topic: Mouse vs. Touch vs. Pen Input
- Replies: 7
- Views: 4945
Mouse vs. Touch vs. Pen Input
Hi, I would like to know if it is possible to distinguish between pen and touch input. By pen, I mean either Surface pen, or Wacom tablet pen, with pressure levels. What I'd like to do is play around with making simple drawing apps for prototyping some ideas. I'd like to be able to use the pen with ...
- Mon Apr 27, 2015 3:34 pm
- Forum: Support and Development
- Topic: math.clamp?
- Replies: 18
- Views: 34396
Re: math.clamp?
Here's another way. function clamp(val, min, max) if val < min then val = min elseif max < val then val = max end return val end Note a subtlety... if min is 0 and your value is -0, it will remain -0. If you really want it to become 0 (e.g. could matter for printouts) then change the comparisons lik...
- Sun May 25, 2014 12:35 am
- Forum: Support and Development
- Topic: Domain-Specific Languages for Games
- Replies: 9
- Views: 6434
Re: Domain-Specific Languages for Games
I've been playing around with Lua internal DSLs as well. Take something like this: local END = LNVL.Scene() function END.script() Jeff “I hate you. I hate you so much.” ... end local NOT_GUILTY = NOT_GUILTY.Scene() function NOT_GUILTY.script() Eric “Not Guilty, your honor!” ... end Now assume your s...
- Sat May 24, 2014 7:51 pm
- Forum: Support and Development
- Topic: Domain-Specific Languages for Games
- Replies: 9
- Views: 6434
Re: Domain-Specific Languages for Games
Lua technically is a DSL, as it was born as one (when PETROBRAS hired TeCGraf at PUC-Rio to write a DSL for them). There are The trick is as I said, metatables: Room = setmetatable({}, { __call = function(original, created) -- manipulate the new room here return created end }) In this case, you can...
- Wed Jul 18, 2012 10:54 pm
- Forum: General
- Topic: The Raspberry Pi
- Replies: 13
- Views: 12594
Re: The Raspberry Pi
OK I managed to port LOVE to GLES2 (code-wise, at least, enough to play Mari0). I've built it on Raspberry Pi. But it's still linking (well, failing to link) to glX. I'm at the point where I'm trying to get it properly linked so I can ascertain whether it can run, or whether I need to edit SDL or so...
- Mon Jul 16, 2012 3:44 am
- Forum: Games and Creations
- Topic: Adventures of Barnabus! [T.A.O.T.R.T.W.G.E.]
- Replies: 93
- Views: 37555
Re: T.A.O.T.R.T.W.G.E.
I think it's already been taken care of, but yeah, heightmaps (plasma) using the diamond square algorithm look nice, I have Lua code to do it on my github: https://github.com/mlepage/heightmap
- Mon Jul 16, 2012 3:33 am
- Forum: Libraries and Tools
- Topic: Simple plasma effect
- Replies: 6
- Views: 5449
Re: Simple plasma effect
Nice!
Is that using recursive subdivision? I have some Lua code that does that, using diamond-square algorithm, see here: https://github.com/mlepage/heightmap
Is that using recursive subdivision? I have some Lua code that does that, using diamond-square algorithm, see here: https://github.com/mlepage/heightmap
- Mon Jul 02, 2012 4:27 am
- Forum: General
- Topic: Plugins for Notepad++
- Replies: 7
- Views: 4483
Re: Plugins for Notepad++
I am currently using Sublime Text 2 after a few years of Notepad++. Both are nice and perfectly serviceable.
- Sat Jun 30, 2012 9:35 pm
- Forum: General
- Topic: Lua rounding and comparation of floats
- Replies: 6
- Views: 4560
Re: Lua rounding and comparation of floats
Generally, you would use thresholds in your comparisons, to tell if it is "close enough". It's not that the floating-point operations are inaccurate, since they are perfectly accurate and deterministic (repeatable). It's that they aren't real math, they are a model (approximation). They re...
- Sat Jun 30, 2012 9:29 pm
- Forum: General
- Topic: The Raspberry Pi
- Replies: 13
- Views: 12594
Re: The Raspberry Pi
I recently obtained a Raspberry Pi. I have been running the "squeeze" and "wheezy" Debian images. My understanding is that floating point support is still software-emulated, and so that will be slow until hardware support is enabled. Also, X Windows isn't as hardware accelerated ...