turbocookie Posted April 7, 2010 Author Share Posted April 7, 2010 Hey i wanted my ingame chatbox to be like half see through so that u can see the game behind it.does anyone have a script i can use to do this? thanksAlso to make my hp/mp/exp images transperent. thanks! Link to comment Share on other sites More sharing options...
DFA Posted April 7, 2010 Share Posted April 7, 2010 Direct3D natively supports alpha blending Link to comment Share on other sites More sharing options...
turbocookie Posted April 7, 2010 Author Share Posted April 7, 2010 i dont know what your talking about, sorry, can you please explain it better? im new at this stuff, sorry for sounding nooby. thanks for the reply though! Link to comment Share on other sites More sharing options...
Sealbreaker Posted April 7, 2010 Share Posted April 7, 2010 eclipse uses dx7.. you need dx8 for transparency ( i think i read this somewhere)-seal Link to comment Share on other sites More sharing options...
turbocookie Posted April 7, 2010 Author Share Posted April 7, 2010 so my chatbox HAS to be a grey that noone can see through? gay… :(is there anyway to remove the box and just the text is there then?thx Link to comment Share on other sites More sharing options...
PD Posted April 7, 2010 Share Posted April 7, 2010 ye there is a way, i think i saw a tut on showing the text on the game screen without a textbox but it will be a source edit. Link to comment Share on other sites More sharing options...
turbocookie Posted April 7, 2010 Author Share Posted April 7, 2010 alrighty, ill take a look, thanks guys! Link to comment Share on other sites More sharing options...
Godlord Posted April 7, 2010 Share Posted April 7, 2010 This is obviously a source question as scripting can't get this done. So I'm escalating this thread to the Source Questions board.The only ways to get a transparent textbox is via GDI, GDI+ or DirectX. As GDI and GDI+ aren't suitable for games actually, it's recommended to do it through DirectX, in which case you're basically enforced to use Direct3D instead of DirectDraw since the alpha channel isn't common in DirectDraw.Regards, Godlord. Link to comment Share on other sites More sharing options...
turbocookie Posted April 7, 2010 Author Share Posted April 7, 2010 hahaha godlord you are very technical you know, us noobs (me) dont understand too much of it =] Link to comment Share on other sites More sharing options...
Godlord Posted April 7, 2010 Share Posted April 7, 2010 @turbocookie:> hahaha godlord you are very technical you know, us noobs (me) dont understand too much of it =]Then do some research. You have Google, Wikipedia, MSDN, etc. at your disposal and yet you don't do anything with that. We're not here to provide you a detailed guide on how to add feature X to your game.Regards, Godlord. Link to comment Share on other sites More sharing options...
turbocookie Posted April 7, 2010 Author Share Posted April 7, 2010 trust me i am using them except the MSDN i didnt install it xD Link to comment Share on other sites More sharing options...
Godlord Posted April 7, 2010 Share Posted April 7, 2010 @turbocookie:> trust me i am using them except the MSDN i didnt install it xDThe MSDN is available online, if you Googled a bit, you would have known that. [Visual Basic 6.0 Resource Centre](http://msdn.microsoft.com/en-us/vbrun/default.aspx).Regards, Godlord. Link to comment Share on other sites More sharing options...
Robin Posted April 7, 2010 Share Posted April 7, 2010 As Dmitry said, you can use alpha blending in Direct3D. Eclipse uses DirectDraw7, however, which doesn't natively support it.The only ways to do this is to have a D3D and DD7 hybrid (Which is beyond you) or to steal the current night rendering system and lock the DC every loop, use some sort of C++ library to alpha blend (vbDabl does something like this, but only with 16bit? I think), then unlock the DC.Slow, but the only way you're going to do it. Link to comment Share on other sites More sharing options...
DFA Posted April 7, 2010 Share Posted April 7, 2010 they don't want DD7 D3D hybrids, thats why they wiped DD off the face of the earthcheck out robin's godlinessbtw, epic FPS there Link to comment Share on other sites More sharing options...
tommy87 Posted April 8, 2010 Share Posted April 8, 2010 I try..I found [this](http://www.vbforums.com/showthread.php?t=438895&highlight=transparent+TextBox).I report a portion of that code only for a question of speed.I repeat, it's not a my own code\work.```Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" ( _ ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongPrivate Const GWL_EXSTYLE = (-20)Private Const WS_EX_TRANSPARENT = &H20&Private Sub Form_Load() SetWindowLong RichTextBox1.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENTEnd Sub```You just need only of a [ RichTextBox1 ].I test it and the result is cool. :DIt can resolve your problem, for a part.Lemme know please.–-updateWhoa.. I'm a bit surprised.See, test [this](http://www.a1vbcode.com/app-2467.asp).Yeahyeah, now I will resolve a few of things. Link to comment Share on other sites More sharing options...
tommy87 Posted April 9, 2010 Share Posted April 9, 2010 About transparent PictureBox.This is a way to get a transparent background. Pay attention, it's the first time you will use a User Control - I guess. An User Control permits you to create your own controls. In this case it will permit you to unite an image with a color mask. Think, in this way you can stuck and delete the background color (that you wish) from the image.So, test this.Create a new project in VB6\. "Menu > Project > Add User Control". Don't care to rename the [ User Control ], it's called [ User Control 1 ] by default. - From now I will work only in [ User Control ].In "Properties" of [ User Control ], set [ BackStyle ] to [ 0 - Transparent ] . Now, add a new [ Picture Box ] and, in "Properties", set [ Visible ] to [ False ] - don't care about the sizes of [ Picture Box ].Double click on [ User Control ] - you enter in code mode. Add this:```Public Property Set Pic(ByVal vNewValue As Variant) Picture1.Height = UserControl.Height Picture1.Width = UserControl.Width Set Picture1.Picture = vNewValue Set UserControl.Picture = Picture1.Image Set UserControl.MaskPicture = Picture1.ImageEnd PropertyPublic Property Get MaskColor() As Long MaskColor = UserControl.MaskColorEnd PropertyPublic Property Let MaskColor(ByVal vNewValue As Long) UserControl.MaskColor = vbNewValueEnd Property```Shortly. [ Public Pic ] permits to load an image, it will be masked.[ MaskColor ] permits to cut off the background color of the image loaded by [ Public Pic ].Now, close the [ User Control ] window. Back to [ Form1 ].*If you won't close [ User Control ] window, you can't use it anywhere*.Look your "Tool Box", a new component is present. It's the [ User Control ] created, before. Drag the component in [ Form1 ].Add a new [ PictureBox ] and import an image with a monocromatic background - look for an example\make an your own image -.Add this in [ Form1 ] code:```Private Sub Form_Load() UserControl11.Top = Picture1.Top UserControl11.Left = Picture1.Left UserControl11.Height = Picture1.Height UserControl11.Width = Picture1.Width UserControl11.MaskColor = &H80000005 Set UserControl11.Pic = Picture1.Picture Picture1.Visible = FalseEnd Sub```* Black = &H00000000(&)* White = &H80000005(&)* Red = &H000000FF(&)* Fuxia = &H00FF00FF(&)* Green = &H0000FF00(&) Link to comment Share on other sites More sharing options...
turbocookie Posted April 9, 2010 Author Share Posted April 9, 2010 tommy imgonna give this code a shot tonight, it looks complicated though, so knowing me ill do something wrong xD but, ill try my best =D thanks for ur help throughout this! Link to comment Share on other sites More sharing options...
Robin Posted April 9, 2010 Share Posted April 9, 2010 Making a user control is completely over the top.If you want a transparent RTB, just use the age-old method of doing so.It's not hard to create a rendered chat box, however. You just need to create a self-managed string array, a render procedure, a text wrapper and the user's input on the scrollbar. Link to comment Share on other sites More sharing options...
tommy87 Posted April 9, 2010 Share Posted April 9, 2010 > @Robin -Making a user control is completely over the top.Well, this topic makes me interested and that was my first answer.> @Robin -self-managed string array, a render procedure, a text wrapper and the user's input on the scrollbar.Sorry but at this point I'm curious. I come from Java, where an array must have a length fixed\declared. I dunno in VB, but in Java if you increase the length of an array, you need to declare a new array with a function and blablabla.So, -example- in which way do I use an array? Is VB able to increase the length of the array automatically everytime? And the array should save what players write\tell, right?About scrollbars there're not problems, I guess. I can take inspiration from "scrollbars" buttons of the old standard inventory.I'm really tring to understand it, but I get some difficulties to image the function of array and how it should run. Please, give me also some suggestions.Thanks. Link to comment Share on other sites More sharing options...
Robin Posted April 9, 2010 Share Posted April 9, 2010 Redim the array. Link to comment Share on other sites More sharing options...
tommy87 Posted April 9, 2010 Share Posted April 9, 2010 > @RobinWhoa… You gained 100 points of esteem.Just at the begginning I though "Redim = Reorganize" .. So I had doubts. So, before to post I wanted to catch the essence of your post. I'm not so expert to.. understand.. an entire concept from a command.Ahahah.You gave me the answer more precise I could get - thanks.Really, a short example - please confirm it:```Redim Array(n)```So if I want to increase it I need simply to write [ Redim Array(n+X) ] ?I have just noticed a function to preserve the datas already in the array.Small doubt - so I return in theme of this topic -: I won't to overload Client\Server connection in this way, right? I'm just thinking what can happen with the management of more links (bah.. 200-300). Eh.. the Array have to be read and reload again in every Client but it's located only in Server.. This just is only a thought..Awaiting for your answer about it.Anyway now I think to understand how to code, I would need to try.Thanks again. Link to comment Share on other sites More sharing options...
Robin Posted April 10, 2010 Share Posted April 10, 2010 If you want to preserve the data them just redim preserve. :P```Redim Preserve nValue(1 to 30) as integer``` Link to comment Share on other sites More sharing options...
tommy87 Posted April 10, 2010 Share Posted April 10, 2010 Yessum, thanks.Eheh, I noticed that, as I wrote in my previous post.Good, I will try to use this new strument. Mh.. It could be useful for me to update my multiple system of èrivate chat(s).- Oook, I'm OT now. Let's skip it, thanks! :D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now