Search found 40 matches

by girng
Wed Sep 12, 2018 4:14 pm
Forum: Support and Development
Topic: how to stretch image out from center like w/ skins / theming?
Replies: 6
Views: 4032

Re: how to stretch image out from center like w/ skins / theming?

You can do it in one draw call with a Mesh or a SpriteBatch. o really? is there an example of how i can convert my btn img to mesh (and how to draw it)? i was searching, i found patchy, but i kinda wanna do this mesh thing now lol edit: https://love2d.org/wiki/love.graphics.newMesh looks like id on...
by girng
Wed Sep 12, 2018 4:06 pm
Forum: Support and Development
Topic: how to stretch image out from center like w/ skins / theming?
Replies: 6
Views: 4032

Re: how to stretch image out from center like w/ skins / theming?

Hi girng (I think) what you're referring to is 9-slicing . It's possible in any language. Using that term I'm sure you can find tutorials on how to do it. Off the top of my head, in Love2d I'd just use a mesh taking care of the coords and uv coords - you could do it "manually" with a bunc...
by girng
Wed Sep 12, 2018 3:44 pm
Forum: Support and Development
Topic: how to stretch image out from center like w/ skins / theming?
Replies: 6
Views: 4032

how to stretch image out from center like w/ skins / theming?

https://i.gyazo.com/62fe73fb503291b083af82330b595305.png for example, in godot's theming system we could "draw from center" and the outside of it would look smooth (not scaled), but the inside of the image is scaled / repeated. is this possible with love2d? here is a direct link to the bu...
by girng
Wed Sep 12, 2018 3:42 pm
Forum: Support and Development
Topic: is initializing a local variable in mouse move ok?
Replies: 3
Views: 2442

Re: is initializing a local variable in mouse move ok?

Ulydev wrote: Wed Sep 12, 2018 2:48 pm I don't think this will have any meaningful impact on performance. As for memory usage, Lua's garbage collector will take care of it, so it's fine.
thanks for support and information. i feel better =]
by girng
Wed Sep 12, 2018 12:28 pm
Forum: Support and Development
Topic: is initializing a local variable in mouse move ok?
Replies: 3
Views: 2442

Re: is initializing a local variable in mouse move ok?

UPDATE OK i fixed it!! :Ddddddddddd

Code: Select all

    local world_pos_obj = { width = 1, height = 1}
    world_pos_obj.x, world_pos_obj.y = camera:mousePosition()
it works =]. so ignore that part please. please focus on just my first question ty
by girng
Wed Sep 12, 2018 12:23 pm
Forum: Support and Development
Topic: is initializing a local variable in mouse move ok?
Replies: 3
Views: 2442

is initializing a local variable in mouse move ok?

for example, look at all the new memory addresses it creates. is this normal, bad, ok? https://i.gyazo.com/1d0a1dbd698980d2957f90dbdcbda976.png i use it because of my is_overlap function code: https://i.gyazo.com/4966889693317e1de18359030abd37c1.png i'm also trying to get `camera:mousePosition()` to...
by girng
Wed Sep 12, 2018 11:05 am
Forum: Support and Development
Topic: how to attach a shader to a sprite?
Replies: 5
Views: 2711

Re: how to attach a shader to a sprite?

ok i think i got it.

i can't just copy and paste shaders online because the extern thing needs get data from :send?
i did :send and i am starting to see some of the outlines
by girng
Wed Sep 12, 2018 10:55 am
Forum: Support and Development
Topic: how to attach a shader to a sprite?
Replies: 5
Views: 2711

Re: how to attach a shader to a sprite?

That shader only draws the outline itself, not the sprite. After drawing it, you need to draw the sprite again. When you say "glow", I'm not sure if you mean a bloom effect, or an outline. These are different effects. If you mean bloom effect, this thread talks about it, https://love2d.or...
by girng
Wed Sep 12, 2018 9:51 am
Forum: Support and Development
Topic: how to attach a shader to a sprite?
Replies: 5
Views: 2711

Re: how to attach a shader to a sprite?

You set the shader you want to use, then draw the sprite you want to use the shader on. http://blogs.love2d.org/content/let-it-glow-dynamically-adding-outlines-characters can be relevant, although it's probably for an older version; still some of the techniques may still apply. ty. just read over i...
by girng
Wed Sep 12, 2018 9:10 am
Forum: Support and Development
Topic: how to attach a shader to a sprite?
Replies: 5
Views: 2711

how to attach a shader to a sprite?

i have a shader in godot: shader_type canvas_item; uniform float aura_width=2; uniform vec4 aura_color=vec4(0.4,0.7,0.3,1); //uniform vec4 aura_color : hint_color; void fragment() { vec4 col = texture(TEXTURE,UV); vec2 ps = TEXTURE_PIXEL_SIZE; float a; float maxa=col.a; float mina=col.a; a=texture(T...