New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparency fail #37

Closed
joelcnz opened this Issue Mar 21, 2015 · 16 comments

Comments

Projects
None yet
2 participants
@joelcnz

joelcnz commented Mar 21, 2015

I set a colour for transparency, but it doesn't work on Dgame, (it works on other programs, like GIMP).

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 21, 2015

Which part? Surface, Texture, Shape? Or do you mean the background?

@joelcnz

This comment has been minimized.

joelcnz commented Mar 21, 2015

Using the Spritesheet. It's not a big one, it works with the PNG files saved with GIMP.

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 21, 2015

Can you post your code (and maybe your image)? That would help a lot to reproduce what is happening.

@joelcnz

This comment has been minimized.

joelcnz commented Mar 21, 2015

I don't think it's real problem. Looks like I can fix it with GIMP.

The attachment is the graphic which the transparency doesn't work for.

On Sat, Mar 21, 2015 at 10:40 PM, Randy Schütt notifications@github.com
wrote:

Can you post your code (and maybe your image)? That would help a lot to
reproduce what is happening.


Reply to this email directly or view it on GitHub
#37 (comment).

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 21, 2015

Ok, keep me up to date.

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 22, 2015

@joelcnz Could you solve the problem? Is it a problem with Dgame?

@joelcnz

This comment has been minimized.

joelcnz commented Mar 23, 2015

Looks like it happens with a curtain viewers saving an image (choose
transparency colour, and I click on which one I want). But it works with
GIMP alright, I don't feel I have to work around it. I don't think it's
worth fixing.

Another thing. Could you put in indexing with the sprite sheets. Access
each texture with a number. The thing there already doesn't work very well
and doesn't work hardly any way.

Just one other thing, this crashes the program.

Surface[string] sufs;
sufs["left"] = Suface("tankLeft.png");
sufs["right"] = Suface(tankRight.png");

On Mon, Mar 23, 2015 at 4:07 AM, Randy Schütt notifications@github.com
wrote:

@joelcnz https://github.com/joelcnz Could you solve the problem? Is it
a problem with Dgame?


Reply to this email directly or view it on GitHub
#37 (comment).

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 23, 2015

You can use setTextureRect and slideTextureRect
Example: You image consist of your 'tankLeft' and 'tankRight' (the left tank is on the left part, the right tank on the right part of the image). Let us assume each of them has a size of 64x64 pixel. Now we declare a new Spritesheet Spritesheet s = new Spritesheet(your_texture, Rect(0, 0, 64, 64));
Now you can move the rect over the image. First you will see the left part but after you called s.slideTextureRect(); you will see the right part. And after a further call you will see (again) the left part.

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 23, 2015

But indexing would be nice, too. Let me see what I can do this evening. ;)

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 23, 2015

Surface[string] sufs;
sufs["left"] = Suface("tankLeft.png");
sufs["right"] = Suface(tankRight.png");

I will investigate this. Thank you.

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 23, 2015

@joelcnz

This comment has been minimized.

joelcnz commented Mar 23, 2015

Might want to be able to get the number of total frames.

I'd say, this issue can be closed.

On Tue, Mar 24, 2015 at 11:52 AM, Randy Schütt notifications@github.com
wrote:

Seems you've discovered a bug:
http://forum.dlang.org/thread/bug-14321-3@https.issues.dlang.org%2F
and regarding indexing:
http://dgame-dev.de/?package=graphic&module=Spritesheet#Spritesheet.selectFrame

Can this be closed?


Reply to this email directly or view it on GitHub
#37 (comment).

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 23, 2015

Might want to be able to get the number of total frames.

I'll think about it. ;)

@Dgame Dgame closed this Mar 23, 2015

@joelcnz

This comment has been minimized.

joelcnz commented Mar 24, 2015

I don't think your, select frame, is working properly. I've got a 4 frames
sprite sheet, but I can't access the forth one, (with selectFrame).

Also, shouldn't the first frame number be 0, not 1.

One other thing. I think 'int' is cleaner (in a way), than ubyte. For
example: selectFrame(cast(ubyte)(idx + 1));

On Tue, Mar 24, 2015 at 12:18 PM, Joel Christensen joelcnz@gmail.com
wrote:

Might want to be able to get the number of total frames.

I'd say, this issue can be closed.

On Tue, Mar 24, 2015 at 11:52 AM, Randy Schütt notifications@github.com
wrote:

Seems you've discovered a bug:
http://forum.dlang.org/thread/bug-14321-3@https.issues.dlang.org%2F
and regarding indexing:
http://dgame-dev.de/?package=graphic&module=Spritesheet#Spritesheet.selectFrame

Can this be closed?


Reply to this email directly or view it on GitHub
#37 (comment).

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 24, 2015

Yeah, don't code at night... I'll fix that soon.

@Dgame

This comment has been minimized.

Owner

Dgame commented Mar 24, 2015

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment