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 / Putting object over sprite?

Author
Message
RobPugh0829
3
Years of Service
User Offline
Joined: 7th Feb 2016
Location:
Posted: 8th Nov 2018 18:47
Hi Everybody,
Maybe somebody can help me. I'm a little stuck. I have a background sprite that I want to use, and then I want to put a cube in front of that, so I used the makeobjectbox function and it makes the object behind the sprite no matter what I tried. Can anybody please point me in the right direction so I can put the object in front of the sprite?

Thanks All!

Have a great day!
puzzler2018
User Banned
Posted: 8th Nov 2018 18:51 Edited at: 8th Nov 2018 19:00
Try setspritedepth(spite,-1)




My apologies - that doesnt work

Try this though



fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 8th Nov 2018 20:38
If you mean you are making a 3d game and want a background sprite that cant be done as all sprites are
drawn after and infront of any 3d models

but what you can do is make an object plane setting it towards the back if you want it to animate you would
have to change the frames yourself.

An example of how i create my digital scoreboard should help for changing the images on the background
PS you don't need to delete each object prior to changing the image I do that as it was just easier to support
all number sizes

fubar
puzzler2018
User Banned
Posted: 8th Nov 2018 20:40
No upset - but isnt that what my 2nd snippet does. sets the background sprite as far back as possible and global3ddepth for other 3d objects be less than the background one

try my 2nd snippet

unless im misunderstanding
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 8th Nov 2018 21:01 Edited at: 8th Nov 2018 21:02
your right Puzzler I have never heard of that command until today must be a newer since I last checked

SetGlobal3DDepth
Description

Sets the position of all 3D objects relative to 2D objects. For example using a global 3D depth of 100 would mean
that all sprites at a depth less than or equal to 100 would appear above any 3D objects whilst sprites at a depth
greater than 100 would appear below any 3D objects.

I would have to do tests ofcourse but I think that command may work well for background or front sprites its new
to me I still work oldskool hahahahha

Certainly be an improvement on the way I do background shaders
fubar
RobPugh0829
3
Years of Service
User Offline
Joined: 7th Feb 2016
Location:
Posted: 8th Nov 2018 21:08
Thanks all, I will try this tonight when I get a chance to work on it again. I'm not making a 3d game, but what I want to do is make a menu that has a sprite background and sprite options, but I want little cubes rotating in front of them that will have an image that matches the corresponding choice. If it isn't able to be done, then no worries as it's not a game I am releasing, it's just for my kids for their new tablets they are getting for Christmas, but if it can be done, it will be a lot cooler looking at the menu screen. Just because it's not being done as a professional project, I still want it to look and feel as professional as possible without add too much of the small details.

Thanks again everybody!

Have a great rest of the day!
puzzler2018
User Banned
Posted: 8th Nov 2018 21:15
Your very much welcome - this will work for you, promse with the help of Fubarpk too

and bless you RobPugh0829 - hope you and family have a lovely xmas 2018 too
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 8th Nov 2018 21:20 Edited at: 8th Nov 2018 21:20
That's a great Idea
and would work really well for an item inventory selector for a 3DGame
where a scrolling selector could be used displaying the 3dmodel infront
when its the one in middle for example.

There you go puzzler a new item selector for minecraft
fubar
puzzler2018
User Banned
Posted: 8th Nov 2018 21:29 Edited at: 8th Nov 2018 21:30
Yeah - thats sound good instead of converting them to sprites

You know, AppGameKit has lots of commands that all but some are very useful in their own way to produce something ingenuis, I just need to explore that command documentation from time to time - I only found this command just out of luck

puzzler2018
User Banned
Posted: 8th Nov 2018 21:31 Edited at: 8th Nov 2018 21:32
A possible new challenge - create a game that uses every single AppGameKit command (at least once) within the App..... Interesting...
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 9th Nov 2018 12:35
Might not fit your attempt, but wanted to point out you could create a sprite from your 3D object by rendering it to an image and pass that to a sprite which is above your background layer.
RobPugh0829
3
Years of Service
User Offline
Joined: 7th Feb 2016
Location:
Posted: 9th Nov 2018 14:27
Thanks everybody, I'm happy to report this worked flawlessly. I now have 5 little cubes rotating next to the menu items. Thanks again so much to all of you for all of your help!

Login to post a reply

Server time is: 2019-04-22 08:14:29
Your offset time is: 2019-04-22 08:14:29