web backgrounds

Find quick help here to get you started with Hollywood
Post Reply
User avatar
Juan Carlos
Posts: 932
Joined: Mon Sep 06, 2010 1:02 pm

web backgrounds

Post by Juan Carlos »

I have one big doubt and problem for me, I tryed since several years use the web background in one program but I haven't got that one background picture of web style is show in all screen program as in a web site, in the web case is more easy the instruction and the browers make the job but with Hollywood I not see and perhaps the routine will be very easy, here is my current code:

Code: Select all

;This background has the size of 113x113 pixels.
@BRUSH 1, "Graficos/BGRosas.jpg", {Loader="inbuilt"}

/**************************************************************************************************/
@DISPLAY {Title="Textura de fondo", Width=640, Height=480, Color=#BLACK, Borderless=False, NoClose=False,
	 KeepProportions=True, Sizeable=False, NoModeSwitch=True}
/**************************************************************************************************/

BeginRefresh()
Local NumColum=0
Local Columna=0
Local NumLinea=0
Local Fila=0

Local Ancho=GetAttribute(#BRUSH, 1, #ATTRWIDTH) ;Obtenemos el ancho del gráfico.
Local Alto=GetAttribute(#BRUSH, 1, #ATTRHEIGHT) ;Obtenemos el alto del gráfico.
  
NumColum=Div(640, Ancho) ;Dividimos para saber el número de veces que habría que mostrar el gráfico.
NumColum=Int(NumColum) ;Cogemos el valor entero sin decimales.
NumColum=Add(NumColum, 1) ;Le añadimos 1 para equilibrar los decimales quitados.

NumLinea=Div(480, Alto) ;Dividimos para saber el número de veces que habría que mostrar el gráfico.
NumLinea=Add(NumLinea, 1) ;Le añadimos 1 para equilibrar los decimales quitados.
NumLinea=Int(NumLinea) ;Cogemos el valor entero sin decimales.

;Dibujamos la fila 0 todas las columnas.
/*For LimiteColum=0 To NumColum 
   DisplayBrush(1, Columna, Fila)
   Columna=Add(Columna, Ancho)
Next*/

;Dibujamos la columna 0 todas las filas.
For LimiteFila=0 To NumLinea
   DisplayBrush(1, Columna, Fila)
   Fila=Add(Fila, Alto)
Next
EndRefresh()

EscapeQuit(True)
Repeat
  WaitEvent
Forever
I tryed with the For Next even making a mix between the two For Next one for the columns and other for the lines but nothing, where is the key that I don't get see???
Thanks-
User avatar
airsoftsoftwair
Posts: 5834
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: web backgrounds

Post by airsoftsoftwair »

No need to do this manually. Just use #FILLTEXTURE draw style and then just draw a box, like so:

Code: Select all

SetFillStyle(#FILLTEXTURE, 1)
Box(0, 0, 640, 480)   ; fill box with brush 1 as texture
And you're done.
User avatar
Juan Carlos
Posts: 932
Joined: Mon Sep 06, 2010 1:02 pm

Re: web backgrounds

Post by Juan Carlos »

Thank you Andreas, I though the Road more difficult not so easy as your code.
Post Reply