Author Topic: BlendScreen - iPhone  (Read 2528 times)

Offline fjsantosb

  • Dr. Type
  • ****
  • Posts: 258
    • View Profile
    • Tip Tap Games - iPhone, iPad and iPod Touch Games
BlendScreen - iPhone
« on: 2009-Sep-29 »
Hi There!
I recently discover that behaviour of method blendscreen is not like on pc.
Its suppose its fades current buffer to a picture.
On windows works well, but on iPhone, its fades from black to a picture.
Anyone have same problem? Any solution?

Thanks in advance.

Best Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10713
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: BlendScreen - iPhone
« Reply #1 on: 2009-Sep-29 »
In landscape mode, these commands do _not_ work:
BLENDSCREEN, GRABSPRITE, USEASBMP.

If I make them work one day, they will be horribly slow, so don't use them in the first place.

Offline mykyl66

  • Mr. Polyvector
  • ***
  • Posts: 114
    • View Profile
Re: BlendScreen - iPhone
« Reply #2 on: 2009-Oct-02 »
Wish I had noticed this before as I have been using GRABSPRITE..... in landscape mode.

Back to the drawing board so to speak.

Mike R

Offline mykyl66

  • Mr. Polyvector
  • ***
  • Posts: 114
    • View Profile
Re: BlendScreen - iPhone
« Reply #3 on: 2009-Oct-02 »
I am trying to get my head back into programming mode after many years away. WHat is the alternative to using Grabsprite in iphone code. I have a bunch of images in my graphic atlas that need to be able to be called thoughout my game.

Any help is appreciated.

Mike R

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4147
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: BlendScreen - iPhone
« Reply #4 on: 2009-Oct-03 »
Do you mean a series of graphics in a tilestrip? If so, use LOADANIM and DRAWANIM.

If that's not what you meant, then erm...
I came. I saw. I played.

Offline mykyl66

  • Mr. Polyvector
  • ***
  • Posts: 114
    • View Profile
Re: BlendScreen - iPhone
« Reply #5 on: 2009-Oct-03 »
That's a close description except imagine its an a4 page with multiple rows and columns of graphics. Doing it this way means I can load all my graphics in one fell swoop and for a usually a much smaller memory footprint.

I just need to get my thinking cap on. :D. Too many late nights and early mornings with an 8 month old baby.

Cheers

Mike R
« Last Edit: 2009-Oct-03 by mykyl66 »

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1775
    • View Profile
    • Homepage
Re: BlendScreen - iPhone
« Reply #6 on: 2009-Oct-03 »
If you have different sizes of sprites on a big sheet, you need to make sure this sheet is the same height as width, it also has to be within some sort of reasonable size, otherwise older cards won't be able to load the texture. It might even have to be on a power of two boundary, 64, 128, 256 and so on. Or at least on an even 16 pixels or something. It might work without this on your computer but there is bound to be a grafics card that can't handle this :-)

Second thing you do is to use STARTPOLY to draw the sprites from this sheet. This will give you some troubles with doing collision detection though that I haven't worked out yet since I don't need it for my implementation :-) Rotating/scaling is possible but you have to do the calculations yourself.

Offline Uncle

  • Mr. Drawsprite
  • **
  • Posts: 75
    • View Profile
    • www.urbaninteractive.net
Re: BlendScreen - iPhone
« Reply #7 on: 2009-Oct-03 »
Polyvector is the way to go.  We use it in exactly the way you mention.  You will have to write your own collision stuff though but thats not too hard to do.

Offline mykyl66

  • Mr. Polyvector
  • ***
  • Posts: 114
    • View Profile
Re: BlendScreen - iPhone
« Reply #8 on: 2009-Oct-03 »
Cheers for that folks. Its not such a problem for this current game as I can easily lock it to portrait mode but for future reference I will use Polyvector.

Thanks agin.

Mike R

Offline mykyl66

  • Mr. Polyvector
  • ***
  • Posts: 114
    • View Profile
Re: BlendScreen - iPhone
« Reply #9 on: 2009-Oct-04 »
Is there any issue using PRINT and using my Atlas as some kind of font system but instead of letters use images. (this is in place of grabsprite) Is there some reason that would not work or cause some issues?

Cheers

Mike R

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4147
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: BlendScreen - iPhone
« Reply #10 on: 2009-Oct-04 »
If you mean using a bitmap font, then that's easy and fast. Use LOADANIM to load a spritesheet of your characters, then use a function to draw them. I posted a bitmap font function and so did PeeJay.

My basic system is something like this -

Code: GLBasic [Select]
FUNCTION txt: x, y, ss$
 LOCAL xpos=0
 LOCAL i
 LOCAL cr

  FOR i=0 TO LEN(ss$)-1 // Keep writing until you run out of text
   cr=(ASC(MID$(ss$,i,1))-32) // Work out the image number of the specified letter in your text (ss$)

    DRAWANIM 99,cr,x+(xpos*width),y // Draw each character of the text using anim #99
 
     xpos=xpos+1

  NEXT
ENDFUNCTION
 

Usage - txt(X,Y,text$)

Remember to use LOADANIM at the start of your program (I've used anim number 99 in this example).
« Last Edit: 2009-Oct-04 by Ian Price »
I came. I saw. I played.