Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Alpha on drawing lines

Author
Message
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 17th Jun 2013 21:35
This would be extremely beneficial.
If the line drawing is fast (I think it is) then being able set alpha would be really important.

I have some idea to use line drawing in a particle system where even a few hundred particles as sprites cause slowdown on low-end graphic devices (laptops).

Is this possible for the 108 final release? It would give so many benefits for flexibility of speed.

An added bonus would be able to set the depth of the line, but it is not nearly so important as setting alpha.

haliop
User Banned
Posted: 18th Jun 2013 09:41
i would actually want to use that..

but remmember sprite pasting is also fast
so
you can make a sprite line width , set no image to it, set the color you want and set its alpha... that should give you the same result but not using drawline command which is faster yes.

nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 19th Jun 2013 21:44
Sprite pasting isn't that fast really. Especially for particle effects, which is what I need.

I would use the particle system, but it is missing the ability to move the particles manually so is no use in a scrolling game which I need.

I wonder.. is using a blank sprite with colour faster than a sprite with image? I assumed a fake image was created to generate the colour...

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 19th Jun 2013 21:50
Quote: "I would use the particle system, but it is missing the ability to move the particles manually so is no use in a scrolling game which I need."


i guess the particles use the world coords too and move with
SetViewOffset and the emitter can be move with SetParticlesPosition
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 20th Jun 2013 00:02
You can move the emitter, but not particles which have already been emitted - thus can't be used in a scrolling game.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 20th Jun 2013 10:44
jo,normaly they are autonomous.
i see only a command that give the particles a direction,
but it must also set before. AddParticlesForce

what do your particels show or what kind of scrolling game you do?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 20th Jun 2013 19:16
Drawing lines with alpha would be useful, but there are some complications with opaque lines if we want maximum speed, all opaque lines would be drawn first, then all transparent lines on top. But I'll throw this in with the other 2D drawing commands and see what I come up with.

Quote: " is using a blank sprite with colour faster than a sprite with image? I assumed a fake image was created to generate the colour"


It doesn't create an image, so it is marginally faster.
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 20th Jun 2013 19:44
That would be fantastic.
I was wondering if short lines (or single plots) could optionally be bundled in with the particle drawing (points not sprites) as this would appear to be optimal?

With fast lines or plots with alpha, this would give excellent capabilities to procedural generation and own made particles for instance.

@markus - here's the game.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Jun 2013 00:28
Whipped this up. Draws a line of any thickness using a sprite.



nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 21st Jun 2013 07:17
Thanks, but the idea was to use the (faster) drawline function.
I remember doing a sprite line draw back at 1076 (which is still useful, as you can use it for path clamping etc.)

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 21st Jun 2013 09:54
It looks nice.

Login to post a reply

Server time is: 2024-04-28 13:44:45
Your offset time is: 2024-04-28 13:44:45