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 / Transparency Problem?

Author
Message
Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 24th Jul 2013 16:55
Hello everyone,

Just bought new AppGameKit Game kit

I got the demo up running but background is grass and forground is fence. I am trying get my Fence in Transparency but it turn out in black...
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Jul 2013 17:01
What demo?

Did you install v1076 or v10816?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jul 2013 17:17 Edited at: 24th Jul 2013 17:19
a png with alpha channel should work.
in gimp (free paint software) you should see a checked pattern,
also you can add alpha channel there.

alternate maybe using SetImageTransparentColor( iImage, r, g, b )

for 3d you need SetObjectTransparency i belive.
Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 24th Jul 2013 18:42
I am making Shadow of the beast Demo

I have installed v10816

Thanks Markus

My Next step is put Tree in, Cloud and Beast himself then hopefully put some enemys in but I going take one step at time
Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 24th Jul 2013 18:57
I got a problem with one Tree at the moment...

Putting position of the tree on the screen isnt problem but moving the tree is

I cant used setspriteuvoffset as that would be too many tree....

What commands do I have take one tree passing at one time....
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jul 2013 19:15 Edited at: 24th Jul 2013 19:16
??? i think you are using a atlas texture.
x=x+1 is moving

GetSpriteXByOffset()
GetSpriteYByOffset()

SetSpritePositionByOffset( iSpriteIndex, fX, fY )
Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 24th Jul 2013 20:11
I got the Tree Working and thanks again

Now then here come diffcult bit...

Clouds on what they used on their demo was called Zorder i think

what I mean is if you look youtube of shadow of the beast first level then you know what clouds look like as it seem big clouds go on the front, medium clouds behide it and last one is smaller clouds

so what I am saying it is the same as the grass when I done 3 layers of grass?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jul 2013 21:11
SetSpriteDepth ( iSpriteIndex, iDepth )
in agk press F1 and you see more
Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 24th Jul 2013 22:15 Edited at: 24th Jul 2013 22:17
thanks Markus

I got problem with clouds as it doesnt look right!



Image of Clouds 4 for background and you can see it is 640 x 10 as you see my rem statement that say



Cloud itself doesnt look right and I wonder why?
fog
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Newcastle, England
Posted: 25th Jul 2013 00:26
It's just a typo. Your cloud4 sprite isn't using your cloud image.

Clouds4_img=loadimage("sprite_nuages4.png")
Clouds4=createSprite(Clouds4_im)

Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 25th Jul 2013 01:10
How did I not spot that

thanks fog

Just sorting the clouds then sort the music problem next

Then the demo itself is done then next step would be when the demo is on and if user seen enough of it and want press the spacebar to play the game would be great.

So it is good to start small and take it from there
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Jul 2013 09:20
i use this structure and i use a level also as background.
the sub functions return the button/menu number.

Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 28th Jul 2013 16:19
I have used Functions to clear the code up and still sorting the clouds and music suppose be looping

if i sort both out then i would be able upload on youtube then take it from there if i want make into game of it
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 28th Jul 2013 16:38
Looping music should be as simple as playmusic("music.mp3",1), as an example. You can also set it to play once, and then use musicplaying() to detect when it has stopped and restart it. Different systems have had different issues. I'm not sure if there are still sound issues in the latest beta.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 28th Jul 2013 17:58
Make sure, if you do make it into a game, that there is an option to turn the music off (something I do 100% in games).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 28th Jul 2013 18:07
thanks so much and i got the music looping
Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 30th Jul 2013 19:59 Edited at: 30th Jul 2013 20:00
I have been working on Animations which is great but one problem thought I couldnt get rid of black square round the beast when he running and I keep getting errors

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Jul 2013 20:14 Edited at: 30th Jul 2013 20:17
Quote: "SetImageTransparentColor( 1, 0, 0, 0 ) Rem <<<< WHY I keep getting Errors?"


1 is the sprite id not the image id?
SetImageTransparentColor( iImage, r, g, b )

make a LoadMyImage Funtion that loads and make transparent in one
and return the image id.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 30th Jul 2013 20:44
Are your initial sprites using black for the background? Perhaps you should put the SetImageTransparentColor( 1, 0, 0, 0 ) line before you load in the animation frames?

Also, if you are using black, try using a transparency instead. You can simply load your images into a paint package and select the black border with the magic wand tool. Delete it. Normally that will make it transparent. Just make sure it is a raster layer. If you image has a alpha transparency, it should automatically work without the need to set image transparency at all.

Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 30th Jul 2013 22:09
Quote: "
1 is the sprite id not the image id?
SetImageTransparentColor( iImage, r, g, b )

make a LoadMyImage Funtion that loads and make transparent in one
and return the image id.
"


I am not sure on that one and could show me small code example please

The images I used for Beast animations


I am using MS Paint and I dont know if that is good or not

Quote: "
Are your initial sprites using black for the background? Perhaps you should put the SetImageTransparentColor( 1, 0, 0, 0 ) line before you load in the animation frames?
"


I have try that but I still the errors like this




Quote: "
Also, if you are using black, try using a transparency instead. You can simply load your images into a paint package and select the black border with the magic wand tool. Delete it. Normally that will make it transparent. Just make sure it is a raster layer. If you image has a alpha transparency, it should automatically work without the need to set image transparency at all.
"


Which paint program would do that?
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 31st Jul 2013 00:36 Edited at: 31st Jul 2013 00:38
Paint Shop Pro, Gimp, Photoshop, many more, in fact most except paint as far as I know.
If you are using grabs from Shadow of the Beast, which by the looks you are , perhaps the black isn't pure black? Again most paint programs will give you that info.

Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 31st Jul 2013 02:20
I do most of my stuff in paint (cos its there) and crop, resize and recolour using Irfanview.

Small (less than a meg), free, runs without install and can save images with transparency.

It's more of a conversion tool, but can do some basic editing as well.

http://www.irfanview.com/
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 31st Jul 2013 04:19
Gimp and gimp portable are also free. I use it and is actually a good piece of software.

3D Bang Bang 2, check it out!

My website! [href]http:\\www.TeamDefiant.co.uk[/href]
Noob Programmer
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 31st Jul 2013 15:09
Thanks Guys, irfanview is great and It save me coding doing transparency code!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st Jul 2013 17:45
the loadimage return the id and you did not save this id in a variable.
because this you can't set transparent color image id xy, true?

AddSpriteAnimationFrame ( 1, LoadImage ( "Beast1.png" ) )

Example what i mean:
function LoadMyImage ( name$)
id=LoadImage ( name$ )
SetImageTransparentColor( id, 0, 0, 0 )
endfunction id

AddSpriteAnimationFrame ( 1, LoadMyImage ( "Beast1.png" ) )

the better solution is using the transparent channel in png.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 1st Aug 2013 02:55
I thought I'd mentioned this but it must have been another post. You can get a full version of Photoshop now, as it is an old version. Adobe didn't want to suppoert old versions, so released it for free!
http://www.techspot.com/downloads/3689-adobe-photoshop-cs2.html
Not my fave, but very powerful, and well worth a look!

Login to post a reply

Server time is: 2024-11-24 18:56:08
Your offset time is: 2024-11-24 18:56:08