Not sure if it’s because I’m using it wrong or if it’s intentional, but using _r.push() and _r.pop() on _r.rect() allows you to draw outside of the screen area.
Using _r.translate() or _r.rotate() causes certain rectangles to continue drawing beyond the limits of the screen. This behaviour seems to be exclusive to _r.rect(). It also only happens to rectangles that wouldn’t be cut by the screen if they were drawn at their actual location, not the new translated one.
EDIT
It also seems to happen when the rectangle thinks it can’t be seen behind another rectangle. Some of the water squares and waves continue rendering upon going behind the island rectangle. (I turned the waves into rects rather than quads for demonstration purposes). I couldn’t recreate this one outside of this game, suggesting this may be an error with something I’m doing.
I took a quick look at the code for drawing rectangles and sure enough in my haste to add a drawing optimization, I test the visibility of the rectangle before it’s transformed. If the pre-transformed rectangle is completely inside the view-clip, it draws without clipping to save time. This should be pretty easy to solve, I’ll patch it tonight.
so i just found in the original project two little snippets of code put inside of a multiline comment.
The first one being this
if e.altshoot then
x = x - width
e.altshoot = false
else
x = x + width
e.altshoot = true
end
which by removing the --[[ from the start of it and the ]] you unlock a different stream of bullets for you main ship with it alternating from a left and right stream.
and the second code snippet is a neato explosion for the enemy ships (and yourself!)
_r.color(b,.7*b,.3*b,1,1)
local sqrtfrac = math.sqrt(e.frac)
for i=36, 360, 36 do
local lr = i * (math.pi / 180)
local r = 10 + sqrtfrac * 100
local c = math.cos(lr) * r
local s = math.sin(lr) * r
_r.sprite(x+c,y-s,2,4 + b * 20,lr - math.pi * .5)
end
which again by removing the code block ends you unlock the cool animation for deaths!
these are just little things i found when exploring the code trying to figure out how to make a cool thing, so i thought i’d share them since i hadn’t seen them mentioned anywhere.
Sorry to resurrect this topic after its slumber, but I had a few questions regarding the Arcade tool after messing around with it more recently.
Will text be supported?
In my mind this was a big issue but now after playing with the tool I can see most intended uses won’t require text. Even numeric scores can be done pretty easily.
Will there be any methods for clipping pixels?
Yet again, not really a big issue for the intended use of the Arcade, just something I ran into with creating scroll panels. This could be worked around though.
Custom Resolutions?
I’m aware this is planned. My question revolved around 2 sub-questions:
What is the maximum resolution we will be able to use?
How will this display in-game? (fill or stretch etc)
These questions all also slightly revolve around a bigger question: Will the Arcade tool be able to be hooked into the CondI/O system?
I know this was suggested by someone before, but it wasn’t further discussed. I’d love to be able to hook up the potentially crazy contraptions the CondI/O system may allow for to a nice control panel using the Arcade API.
Also, some content as to actually add to the thread: Basics of a UI system V2:
Will text be supported?
Definitely, I have big plans for built-in texture atlas generators for text stuff.
Will there be any methods for clipping pixels?
Yes, there is a built-in clipping system, it’s just not exposed to lua yet.
Custom Resolutions?
Yes, each arcade game class will be able to specify it’s own resolution.
If you set your resolution to 800x600, your in-game coordinates will be uniform-scaled back to fit the “device” it’s displayed on.
The aspect ratio will be matched by adding vertical / horizontal spacers around the view area.
Will the Arcade tool be able to be hooked into the CondI/O system?
Absolutely, this is something I definitely want to do.
Yessssss outrun is the best, just reached stage 4 yesterday and I feel g r e a t
Honestly would love to play Outrun in the arcade. Maybe there should be a racer cabinet? or maybe even just a different control panel for upright machines?
I plan on making a racing cabinet akin to the last picture you posted. It won’t be that exact model but the idea is that it’s one of those sit-down-in-a-car arcade cabinets. So that will be an option for racing themed games.
Sorry for the necro, but since the arcade is currently in active development and after playing around with the Lua API, I wanted to ask if it were possible for the API to support multiple mouse modes, more specifically a relative mouse mode like in SDL: (https://wiki.libsdl.org/SDL_SetRelativeMouseMode), since currently (as is on the Metacade Github page) the API test tool only returns delta mouse motion calculated from the x and y coordinates relative to the window, not the SDL provided xrel and yrel values.
I understand that this might be a niche or otherwise unimportant feature which might not be worth implementing, considering there are a other features which might be more worthwhile to spend time on, but I’d still appreciate it if you could include it in future plans.
So, I got bored, and decided to mess around with the tool again. Ended up writing a SNES Mode-7 style graphics renderer. Hopefully I can add more to this and eventually create a game out of it