MarkusR Posted January 12, 2015 Share Posted January 12, 2015 need one more command for using bitmap fonts. DrawImage(Texture* texture, int x, int y,int offsetx, int offsety, int width, int height) this function already draw all, think its easy to add. 1 Quote PC : Win 10 Pro 64 Bit , 4x cores ~2 GHz , 8 GB RAM , AMD R7 265 2D : Photoline , Zooner Photo Studio 13 , Art Rage Studio 3.5.4 , Ashampoo Snap 7 , ... 3D : Shade 15 Basic , Carrara 8.5 & DAZ Studio 4.8 , Cheetah 3D 6.3.2 , Via Cad 8 Music : Samplitude Music Studio , Music Creator 7 IDE : Leadwerks Engine 3.x , Unity 5.x , (Unreal 4.8.x) , AGK v2.x , Construct 2 , (Clickteam Fusion 2.5) , ShiVa 1.9 , Game Maker Studio , MS Visual Studio .Net , Android Studio , Monkey , ... Link to comment Share on other sites More sharing options...
gamecreator Posted January 12, 2015 Share Posted January 12, 2015 What would those be offsets from? Why not just add them to x and y yourself? Quote Link to comment Share on other sites More sharing options...
Olby Posted January 12, 2015 Share Posted January 12, 2015 What would those be offsets from? Why not just add them to x and y yourself? I think he means offests within a bitmap. If that's the case then we also need bottom left/right offset to have full cropping capabilities. Once the crop is set with offset x/y/x2/y2 then x/y and w/h is used to actually position and size the cropped bitmap. Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64) Link to comment Share on other sites More sharing options...
gamecreator Posted January 12, 2015 Share Posted January 12, 2015 Ah ok. The possible good news here is that you can read and write texture pixels. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/texture/texturegetpixels-r336 Not as simple as what you were looking for but not too bad to implement. 1 Quote Link to comment Share on other sites More sharing options...
Rick Posted January 12, 2015 Share Posted January 12, 2015 I agree. This allows for spritesheets instead of separate images for 2D animations Quote Link to comment Share on other sites More sharing options...
MarkusR Posted January 13, 2015 Author Share Posted January 13, 2015 yo, with that pixel copy i can make new smaller textures and put them into a array, thanks. 1 Quote PC : Win 10 Pro 64 Bit , 4x cores ~2 GHz , 8 GB RAM , AMD R7 265 2D : Photoline , Zooner Photo Studio 13 , Art Rage Studio 3.5.4 , Ashampoo Snap 7 , ... 3D : Shade 15 Basic , Carrara 8.5 & DAZ Studio 4.8 , Cheetah 3D 6.3.2 , Via Cad 8 Music : Samplitude Music Studio , Music Creator 7 IDE : Leadwerks Engine 3.x , Unity 5.x , (Unreal 4.8.x) , AGK v2.x , Construct 2 , (Clickteam Fusion 2.5) , ShiVa 1.9 , Game Maker Studio , MS Visual Studio .Net , Android Studio , Monkey , ... Link to comment Share on other sites More sharing options...
Einlander Posted January 13, 2015 Share Posted January 13, 2015 Ah ok. The possible good news here is that you can read and write texture pixels. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/texture/texturegetpixels-r336 Not as simple as what you were looking for but not too bad to implement. Does this work in lua? Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted January 13, 2015 Share Posted January 13, 2015 What will work in LUA: Edit the drawimage.shader (the Pixel-Shader): On top add a uniform (don't name it "offset". That one is already used by the vertex-shader): uniform vec2 off change the line fragData0 = drawcolor * texture(texture0,vTexCoords0); to fragData0 = drawcolor * texture(texture0,vTexCoords0+off); Now in your LUA-Script just before the call to DrawImage set this value: imgshader = Shader:Load("Shaders/Drawing/drawimage.shader") if(not(imgshader:SetVec2("off", Vec2(0.1,0.1)))) then System:Print("Value could not be set.") end You will probably want to change the value back to (0,0) after you are done drawing. Edit: (The offset will be set in percent, I think) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.