Search found 85 matches

by XHH
Sun Aug 22, 2021 10:30 pm
Forum: Libraries and Tools
Topic: cimgui-love: another LÖVE module for DearImGui using LuaJIT FFI
Replies: 5
Views: 18814

Re: cimgui-love: another LÖVE module for DearImGui using LuaJIT FFI

Do you have an example on how to use imgui::Combo? I'm very new to ffi.
by XHH
Wed Aug 18, 2021 8:51 pm
Forum: Support and Development
Topic: [SOLVED] Weird graphical bug with canvas
Replies: 4
Views: 6082

[SOLVED] Re: Weird graphical bug with canvas

Always set the color to white before draw the canvas. Also do for x = 0, width/snap.x do -- don't render to out of canvas linex = x * snap.x love.graphics.line(linex, 0, linex, height) end It looks like rendering outside of the canvas was the issue! Also setting the color to white solved another is...
by XHH
Wed Aug 18, 2021 1:46 pm
Forum: Support and Development
Topic: [SOLVED] Weird graphical bug with canvas
Replies: 4
Views: 6082

[SOLVED] Weird graphical bug with canvas

Hi, I'm trying to draw a grid using the canvas and graphics methods. For some reason it is sometimes showing a gradient in the background. This doesn't happen if I draw without using a canvas though. Am I using canvas incorrectly? (screenshot and code below) Screenshot from 2021-08-18 09-26-18.png l...
by XHH
Wed Mar 04, 2020 6:45 pm
Forum: Support and Development
Topic: GitHub not loading - Atom
Replies: 1
Views: 5611

Re: GitHub not loading - Atom

I don't use Atom for love2d development myself, but have you tried looking at the information on this wiki page. It may help with your toolbar issue.
by XHH
Mon Mar 02, 2020 6:41 pm
Forum: Support and Development
Topic: [SOLVED] Lua math.cos issue
Replies: 8
Views: 13463

Re: Lua math.cos issue

Interesting! Thanks for explaining.
by XHH
Mon Mar 02, 2020 5:42 pm
Forum: Support and Development
Topic: [SOLVED] Lua math.cos issue
Replies: 8
Views: 13463

[SOLVED] Lua math.cos issue

I simply want to get cos(90 deg) using the following:

Code: Select all

math.cos(math.rad(90))
This is giving me a nasty 6.1232339957368e-17.
I thought cos(90 deg) was 0. My calculator IRL and google also gives me 0.
by XHH
Wed Feb 12, 2020 6:15 pm
Forum: Support and Development
Topic: [SOLVED] Need help with my vertex shader code
Replies: 3
Views: 4968

Re: Need help with my vertex shader code

SOLVED: I figured out a hacky way to do this with pixel shader. I didn't realize texture_coords was normalized while texSize was not. So I didn't really even need to use texSize. It's a shame the vertex shader didn't work how I thought it would though. Would be nice if there were code examples on ho...
by XHH
Wed Feb 12, 2020 4:49 pm
Forum: Support and Development
Topic: [SOLVED] Need help with my vertex shader code
Replies: 3
Views: 4968

Re: Need help with my vertex shader code

Thanks. After learning some stuff about matrix multiplication I'm now trying this: extern vec2 texSize; extern float angle; #ifdef VERTEX vec4 position(mat4 transform_projection, vec4 vertex_position) { transform_projection *= mat4( 1, 0, 0, 0, 0, cos(angle), -sin(angle), 0, 0, sin(angle), cos(angle...
by XHH
Mon Feb 10, 2020 7:07 pm
Forum: Support and Development
Topic: [SOLVED] Need help with my vertex shader code
Replies: 3
Views: 4968

[SOLVED] Need help with my vertex shader code

I'm trying to do a 2d perspective transformation using a vertex shader. Similar to the image below: https://love2d.org/imgmirrur/aGbzh.png I'm currently using this shader code to try and achieve this effect: extern vec2 texSize; number lerp(number a, number b, number t) { return a * (1.0 - t) + b * ...
by XHH
Fri Aug 24, 2018 7:47 pm
Forum: Support and Development
Topic: Pausing animation in ParticleSystem
Replies: 2
Views: 3099

Re: Changing texture and quad in ParticleSystem

BUMP: Anyone know if it's possible to pause the animation in a ParticleSystem that uses quads? I just want to draw each particle to be a different frame of a spritesheet and not change to any other part of the animation.