FB HGEWrapper 2D Game Engine
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
I've been working through the demos trying to think how I might work on games w/ HGE... and for the life of me I can't figure out sprite masking. :-/
Maybe I'm going about it all wrong... but I've got a .bmp spriteset from a previous project where I used RGB(255, 0, 255) as a masking color. Now with HGE I see I have SetColor, SetBlendMode, etc. but I just don't know what to use and when to use it for that color to show up transparent.
Could I maybe get a little help here and/or get clued in on some better methods of doing this? Thank you!
Maybe I'm going about it all wrong... but I've got a .bmp spriteset from a previous project where I used RGB(255, 0, 255) as a masking color. Now with HGE I see I have SetColor, SetBlendMode, etc. but I just don't know what to use and when to use it for that color to show up transparent.
Could I maybe get a little help here and/or get clued in on some better methods of doing this? Thank you!
Ryan
in HGE of no ColorKey...
use TGA or PNG ... transparent channel
http://relishgames.com/forum/
or...
ColorKey(myTexture,ARGB(255,255,0,255))
in HGE of no ColorKey...
use TGA or PNG ... transparent channel
http://relishgames.com/forum/
or...
Code: Select all
Sub ColorKey(ByVal tex As Long,ByVal clr As dword)
Dim As dword Ptr pixels
Dim ix As Integer
Dim iy As Integer
Dim As Integer w = hge_Texture_GetWidth(tex)
Dim As Integer h = hge_Texture_GetHeight(tex)
For ix = 0 To w
For iy = 0 To h
pixels = hge_Texture_Lock(tex,0,ix,iy,w,h)
If (*pixels=clr)then
(*pixels)=ARGB(0,0,0,0)
End If
hge_Texture_Unlock(tex)
Next
Next
End Sub
-
- Posts: 1759
- Joined: May 23, 2007 21:52
- Location: Cut Bank, MT
- Contact:
I get this error when I compile the following code:
GUI.o:fake:(.text+0x1d6): undefined reference to `hge_GUIListbox_AddItem'
I think this function is missing in the .dll or something.
GUI.o:fake:(.text+0x1d6): undefined reference to `hge_GUIListbox_AddItem'
I think this function is missing in the .dll or something.
Code: Select all
#Include "inc/HgeType.bi"
#Include "inc/HgeWrapper.bi"
Declare Function FrameFunc() As Integer
Declare Function RenderFunc() As Integer
Declare Sub Main()
Dim Shared As Long myFont
Dim Shared As Long myGUI
Dim Shared As Long myGUIText
Dim Shared As Long myGUIListbox
Main()
Function FrameFunc() As Integer
If (hge_Input_GetKeyState(HGEK_ESCAPE)) Then Return 1
Return 0
End Function
Function RenderFunc() As Integer
hge_Gfx_BeginScene()
hge_Gfx_Clear()
hge_GUI_Render(myGUI)
hge_Gfx_EndScene()
Return 0
End Function
Sub Main()
hge_Create(hge_VERSION)
hge_System_SetStateFunc(HGE_FRAMEFUNC, @FrameFunc)
hge_System_SetStateFunc(HGE_RENDERFUNC, @RenderFunc)
hge_System_SetStateString(HGE_TITLE, "GUI")
hge_System_SetStateBool(HGE_WINDOWED, 1)
hge_System_SetStateInt(HGE_FPS, 200)
hge_System_SetStateInt(HGE_USESOUND,0)
hge_System_SetStateBool(HGE_SHOWSPLASH,0)
hge_System_SetStateBool(HGE_HIDEMOUSE,0)
If (hge_System_Initiate()) Then
myFont = hge_Font("Res/font1.fnt",0)
myGUI = hge_GUI()
myGUIText = hge_GUIText(12345,100,100,80,20,myFont)
hge_GUIText_SetText(myGUIText,"Hello")
hge_GUI_AddCtrl(myGUI,myGUIText)
myGUIListbox = hge_GUIListbox(54321,100,200,150,500,myFont,RGB(255,0,0),RGB(0,255,0),RGB(0,0,255))
hge_GUIListbox_AddItem(myGUIListbox,"Testing")
hge_GUI_AddCtrl(myGUI,myGUIListbox)
hge_System_Start()
Else
MessageBox(NULL, "hge_System_GetErrorMessage", "Error", MB_OK Or MB_ICONERROR Or MB_APPLMODAL)
End If
hge_System_Shutdown()
hge_Release()
End Sub
-
- Posts: 2428
- Joined: Jul 19, 2006 19:17
- Location: Sunnyvale, CA
- Contact:
My car is broken, can I have a new one please? :-P
http://fusionware.ourproject.org/itech/ ... ge_car.png
I am very impressed with the quality and speed of this engine, and the actual EXE files are only 10-15K!!
That is why I am surprised, that the Internet does not have too much information about the library. (Not even a Wikipedia article.)
I have some questions, because I would like to know about this library.
Is it popular for game programmers, or do they mostly use DirectX instead?
If it uses the Box2D Physics Engine library for physics, does that mean licensing HGE (so I can use it commercially) would be extra complicated?
I probably have some more questions I forgot... :-)
http://fusionware.ourproject.org/itech/ ... ge_car.png
I am very impressed with the quality and speed of this engine, and the actual EXE files are only 10-15K!!
That is why I am surprised, that the Internet does not have too much information about the library. (Not even a Wikipedia article.)
I have some questions, because I would like to know about this library.
Is it popular for game programmers, or do they mostly use DirectX instead?
If it uses the Box2D Physics Engine library for physics, does that mean licensing HGE (so I can use it commercially) would be extra complicated?
I probably have some more questions I forgot... :-)
License
The zlib/libpng License
Copyright (c) 2003-2006 Relish Games
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
This notice may not be removed or altered from any source distribution.
-
- Posts: 2428
- Joined: Jul 19, 2006 19:17
- Location: Sunnyvale, CA
- Contact:
Box2D
FbHGEWrapper-Permission is granted to anyone to use this software for any purpose...This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software...Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
KristopherWindsor
phObj <= 512
Hmm...My car is broken, can I have a new one please? :-P
http://fusionware.ourproject.org/itech/ ... ge_car.png
phObj <= 512