[24 Jul 2009] Brushes
[24 Jul 2009] Brushes
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 24 Jul 2009 18:18:13 +0200
Hello,
Which is the maximum brushes number supported by Hollywood? May I preload 150 brushes?
Which solution is better:
- preload 150 brushes ?
- preload an IFF picture, cut, and then store 150 brushes in memory ?
It's for tiles game.
Thanks for advance for your advises!
Tarzin http://www.amifrance.hw.tc/
Hello,
Which is the maximum brushes number supported by Hollywood? May I preload 150 brushes?
Which solution is better:
- preload 150 brushes ?
- preload an IFF picture, cut, and then store 150 brushes in memory ?
It's for tiles game.
Thanks for advance for your advises!
Tarzin http://www.amifrance.hw.tc/
A500 / A600 / A1200 / SAM440
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[24 Jul 2009] Re: Brushes
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 24 Jul 2009 18:24:37 +0200
As much as your memory can takeHello,
Which is the maximum brushes number supported by Hollywood?
Sure.May I preload 150 brushes?
I'd use the IFF picture and then use DisplayBrushPart() to show the tiles. Then you only need a single brush which saves memoryWhich solution is better: - preload 150 brushes ? - preload an IFF picture, cut, and then store 150 brushes in memory ?
[10 Aug 2009] Re: Brushes
Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 10 Aug 2009 18:59:15 +0200
I've started using displaybruspart () but have a problem with this part of code
In fact, values from 0 to 20 for "a" are for letters A to T Value 21 and more are for letters U to Z But my code is not working. It's only working if I use no switch command and use only letters from A to T
Can you help me?
Thanks!
Eric
I've started using displaybruspart () but have a problem with this part of code
Code: Select all
@BRUSH 2,"sprites.iff", {x=0, y=80, width=320, height=48}
@DISPLAY {title="Match-It!", x=#CENTER, y=#CENTER, width=320,
height=240, color = #GREEN}
text$=UpperStr("u")
posx=0 scry=0
for i=0 to StrLen(text$)-1
a=Asc(MidStr(text$,i,1))-64
Print (a,"")
Switch a
Case 1
scry=0
Case 2
a=a-20
scry=17
EndSwitch
DisplayBrushPart (2,(a-1)*16,scry,posx,50,16,16)
posx=posx+16
Next
Repeat
WaitEvent
Forever
Can you help me?
Thanks!
Eric
A500 / A600 / A1200 / SAM440
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
[11 Aug 2009] Re: Brushes
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 11 Aug 2009 07:03:54 -0000
If I remember correctly the "Switch-EndSwitch" commands works only with constants, you can't use
Switch myvar
if myvar is a variable
Regards, Fabio
If I remember correctly the "Switch-EndSwitch" commands works only with constants, you can't use
Switch myvar
if myvar is a variable
Regards, Fabio
----------------------------
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[11 Aug 2009] Re: Re: Brushes
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 11 Aug 2009 19:26:35 +0200
Thanks for your help. I've tried this way but did not success too
Error is "next without for"
Any idea?
Bye
Eric
Thanks for your help. I've tried this way but did not success too
Code: Select all
text$=UpperStr("test u")
posx=0 scry=0
for i=0 to StrLen(text$)-1
a=Asc(MidStr(text$,i,1))-64
Print (a,"")
if a>20 scry=16 a=a-19 Else scry=0
DisplayBrushPart (2,(a-1)*16,scry,posx,50,16,16)
posx=posx+16
Next
Repeat
WaitEvent
Forever
Any idea?
Bye
Eric
A500 / A600 / A1200 / SAM440
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
[11 Aug 2009] Re: Brushes
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 11 Aug 2009 19:54:19 -0000
Hello Tarzin!! The solution is very simple: you have tested the string "test u" but the space has asc code = 32 so subtracting 64 from this code you have a negative value that break your script. I've tested with the string "testu" (removing the space) and all runs fine. You have to parse the string checking for special character with asc code < 64, for example if you encounter a space you can simply increase the current posx, and so on. Hope to have resolved you problem!!
Good coding! Fabio
P.S.: Here is your original code corrected (a Next was missing):
Hello Tarzin!! The solution is very simple: you have tested the string "test u" but the space has asc code = 32 so subtracting 64 from this code you have a negative value that break your script. I've tested with the string "testu" (removing the space) and all runs fine. You have to parse the string checking for special character with asc code < 64, for example if you encounter a space you can simply increase the current posx, and so on. Hope to have resolved you problem!!
Good coding! Fabio
P.S.: Here is your original code corrected (a Next was missing):
Code: Select all
@BRUSH 2,"sprites.iff", {x=0, y=80, width=320, height=48}
@DISPLAY {title="Match-It!", x=#CENTER, y=#CENTER, width=320,
height=240, color = #GREEN}
text$ = UpperStr("testu") ; <-- Space has asc code = 32 so here you have
a
; negative value which cause and error!
I've removed
; the space for simplicity.
posx = 0
scry = 0
For i = 0 To StrLen(text$)-1
a = Asc(MidStr(text$, i, 1)) - 64
DebugPrint (a, "")
If a>20
scry = 16
a = a - 19
Else
scry = 0
EndIf
DisplayBrushPart(2,(a-1)*16,scry,posx,50,16,16)
posx = posx + 16
Next
Repeat
WaitEvent
Forever
----------------------------
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[12 Aug 2009] Re: Re: Brushes
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 12 Aug 2009 00:25:18 +0200
Nope, that's definitely not true. It wouldn't make much sense if you couldn't use Switch() with variablesIf I remember correctly the "Switch-EndSwitch" commands works only with constants, you can't use
Switch myvar
if myvar is a variable
[14 Aug 2009] Re: Re: Brushes
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 14 Aug 2009 14:36:40 +0200
See you soon with my next problem!
Eric
Thanks a lot for yout help, all run fine now! I'll try to adapt all my original Amos code to Hollywood. That's "the difficulty". My part of the game is done but in Amos.Here is your original code corrected (a Next was missing):
See you soon with my next problem!
Eric
A500 / A600 / A1200 / SAM440
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
WinUAE OS3.9 (AmiKit) / OS4.1FE (FlowerPot)
---
https://twitter.com/TarzinCDK
[15 Aug 2009] Re: Brushes
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 15 Aug 2009 21:36:36 -0000
My faulty memory!!
<Switch variable> is allowed but not <Case variable>, that's right?
Fabio
My faulty memory!!
<Switch variable> is allowed but not <Case variable>, that's right?
Fabio
----------------------------
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
[17 Aug 2009] Re: Re: Brushes
Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 17 Aug 2009 22:11:50 +0200
Case can only handle constants!
ExactlyMy faulty memory!!
<Switch variable> is allowed but not <Case variable>, that's right?
Case can only handle constants!