Dark Bit Factory & Gravity
PROGRAMMING => Purebasic => Topic started by: inc. on October 05, 2014
-
[Edit by Padman] Topic split from here. (http://www.dbfinteractive.com/forum/index.php?topic=6268.0)
well done. very oldschoolish :)
i am working on a interface that can be used for many other releases. at the moment i can't work out the scroller text. looking forward.
if i use a scroller, the transparency of my window disapear :(
screen:
(http://abload.de/img/neu-48piy6.jpg)
-
Nice looking interface! ;) If you post an example code of your transparent window I might have a look and see if it's possible to shoehorn in a scroller.
-
this would be very kind. any help are welcome.
i also use the MP3D Lib. maybe you ever used it?
here comes the Code
-
Yeah I know the MP3D lib. I'll have a look at the code asap. But gimme some time, weekdays I'm usually pretty busy with real life and work... ;)
-
sure. i hope you can figure out the problem.
since i used mp3d lib for the "interface", i encounter the problem that a dx9 screen can not be transparent. this is frustrating. i tried to draw 2 windows. in the background the interface pic with the alpha channel. the macros set both "sticky windows" tranparent. but next, if i use the commands (and they are great :) ) by the mp3d Lib, the window goes BLACK or blue as you can see in the screen shot :( (i have used blue to check if something is working with the background color)
Maybe there is another way to get it on screen. for text Scroll and or sinus / Pager i use EPYX's FX_Lib. if i don't use transparent windows all works good. but it won't if i set the 1st window transparent.
here is a simple example without transparent screen and all works good:
looking forward
and thank you for help
-
Ok, here ya go: a couple of small additions and a scroller's in there. ;) The window remains transparent. I haven't used Epyx' lib for the scroller though. Maybe I'll have a look at that when I find time again. For now it's just recycled code from some other examples here on DBF. Btw, I guess KrazyK's scroller lib should work, too.
PB source file + example exe in the RAR archive. Have a go and play around with it. I think it's a good start at least...
Pad :cheers:
-
well done and thank you very much. :updance: it works with PB4.61... i changed small values :)
next i must check out how to change the scroll speed. first i made a compilation :)
i hope i can help you too if you ever need some. Maye a nice Logo.
have a look at my latetst Demo.
(http://abload.de/img/ampedxzu4a.jpg)
btw. EPYX FX lib can be found in Michael's MP3D Lib
and Thank you again
-
No problem mate. I might get back to your offer, when it's demo time on here again. Because I really suck ass when it comes to creating gfx... ;) Love the style of your latest demo. Well done! :clap:
In case you haven't figured it out yourself already: The scroll speed in my example can be changed at:
sco = sco - 2
Just increase/decrease the value.
-
Very nice inc. I am loving your work mate & a wicked job Padman helping him out :goodpost:
-
@padman
yes i found the string :)
thank you for the help. i'll post some updates when done.
Let me know when it is time to draw something for you
hey dr.death
thank you very much :)
-
Hi PADMAN
is it possible to let the text scroller display on a transparent field? at the moment we draw em on: ClearScreen($464646)
is it possible to set it via ARGB transparent or maybe, there is an other solution?
a small update in the attachment .
thank you for reply
inc
-
Hey mate,
No the way it is done it can't be transparent. The scroller uses a DirectX screen and this screen can only be in a solid color. You'd have to go another way then using a Canvas Gadget or GDI or something. Never did that before, because I never needed it.
If the purpose for the wanted transparency is the fact, that you want to paint the scroller on your background picture where it's not just solid (i.e. on a gradient or something) you can do some trickery though to achive it:
You load the background picture as a sprite. Then clip the wanted portion of the pic:
CatchSprite(2,?Pic_1_Start)
ClipSprite(2,300 ,418,160, 20)
(...)
and then display it on your DirectX screen behind the scroller:
;ClearScreen($434343) ; <-- not needed anymore since the new sprite covers up the whole screen
DisplaySprite(2,0 ,0)
(...)
Not the most elegant way probably, but it works. I made an example, where I moved the scroller to the right over the 'team' logo so you can see it in action. I hope this is what you wanted to achieve. If not, just let me know. I might think of something else then... ;)
Source + Exe attached in RAR archive
Pad :)
P.S. I also removed some useless lines of the scroller code in case you are wondering...
-
PADMAN
same i use for the demo coding --> a DX Screen for the scroller and HLSL shaders. In this case i use a OVERLAY-Picture that contains a Alpha Channel. BLACK will be always transparent.
Your idea with the ClipSprite is a nice idea. i must test and check this option.
Finally, the demo or patcher should be assembled by an User Interface, where the user can choose some effects and options something like this:
-
Me again.
I made a test with your Code. It works great. now i can give the values to the user and he is able to select the scroll area. ergo = pseudo transparency :D nice.
Another question about the scroller:
is it possible to "fade in" and "fade out" the letters at the beginning and at the end in the scroll line?
simple i could overlay a Alpha png but it wont make sense, if i choose another background. in this case, the user must always create a new PNG by the scroll area. not good
-
Hi Inc, and a warm welcome to the site. :)
When I try to run the "Amped" demo on Windows 7 64-bit, I get 2 x "error CreateEff....", and it goes into the demo but has trouble clearing.
Also when I get my act together - life has been really hectic lately. I might ask you for some graphics.
Keep up the good work :)
-
@CLYDE
You must install the latest DX9 Drivers. I used HLSL DX9 Shader and a DX Screen to display the windowed DEMO.
It's working well. i have win7 x64 too.
Let me know what exactly you need.
-
Hi again,
I had a quick try to add some fading to it. It's pretty lame and not really pretty, but I don't have much more time to spend on it at the moment. ;) I think it's something in the right direction, though.
The more steps you add to the fading the smoother it should look. Have a play with it, maybe it's of any use. I might have a 2nd go at it, when I find time again.
RAR archive includes source code + exe. I used PB 5.30 x86.
Pad :cheers:
Global xres.w , yres.w , loop.w ,xp.w , yp.w , t.s , tptr.w , sco.b
t.s=" This is a boring example scroll text to test the fading effect.... wrap "
sco = 0
tptr = 1
FPS = 60
TimerDuration = 1000 / FPS
InitSprite()
InitKeyboard()
window = OpenScreen( 640 , 480 , 32 , "Fading scroller")
If window = 0
MessageRequester("Error", "This is fucked up, I can't open the window", 0)
End
EndIf
CatchSprite(1,?font)
TransparentSpriteColor(1,$000008)
Repeat
timer = ElapsedMilliseconds()
ClearScreen(0)
cco = 0
For cc = 0 To 20
letter = Asc(UCase(Mid(t.s, tptr+cc, 1)))-32
yCharPos = letter / 10
xCharPos = letter % 10
ClipSprite(1, xCharPos*32, yCharPos*44, 32,44)
fade=sco+cco
Select fade
Case -32 To 32
DisplayTransparentSprite(1, (sco+cco),312,2) ;fade out
Case 32 To 48
DisplayTransparentSprite(1, (sco+cco),312,32)
Case 48 To 64
DisplayTransparentSprite(1, (sco+cco),312,64)
Case 64 To 80
DisplayTransparentSprite(1, (sco+cco),312,128)
Case 80 To 96
DisplayTransparentSprite(1, (sco+cco),312,192)
; fade in
Case 512 To 528
DisplayTransparentSprite(1, (sco+cco),312,192)
Case 528 To 544
DisplayTransparentSprite(1, (sco+cco),312,128)
Case 544 To 560
DisplayTransparentSprite(1, (sco+cco),312,64)
Case 560 To 592
DisplayTransparentSprite(1, (sco+cco),312,32)
Case 592 To 660
DisplayTransparentSprite(1, (sco+cco),312,2)
Default
DisplayTransparentSprite(1, (sco+cco),312) ; standard intensity
EndSelect
cco = cco + 32
Next
sco = sco -4
If sco < -32
tptr = tptr + 1
sco = sco + 32
EndIf
If tptr > Len(t.s)-16
tptr = 0
EndIf
TimeGap = TimerDuration - (ElapsedMilliseconds() - Timer)
If TimeGap > 16
Delay( TimeGap - 10 )
EndIf
ExamineKeyboard()
FlipBuffers()
Until KeyboardPushed (#PB_Key_Escape)
End
DataSection
font:
IncludeBinary "font.bmp"
EndDataSection
-
the example exe is not so bad :) ( need to add some smoove fade effect ) :clap:
i have problems to display fullscreen Demos because i use 3 TFT @ 1 gfx Card.
i must rewrite your source. i am still hang in PureBasic 4.61. It is the best version to me, using all the nice "user libs" and "Effects". This version can't handle your code.
looking forward. when i have time i'll post a updated verion by the interface.