I want to draw custom static shapes in my game, just like angry birds:
but the problem is that the texture is square.
how can we say "spritebatch" to draw shapes with some vertices? Does anyone have any ideas?
According to docs :
SpriteBatch is used to draw 2D rectangles that reference a texture (region)
Thus, this method does not allow you to specify any other geometry than the rectangle. However, there is a draw method that allows you to specify the four coordinates of the "rectangle" and turn them into something else. You must decompose the geometry into smaller pieces corresponding to these primitives. It seems that this method is not amenable to changes in geometry.
You better create a grid and just draw it. The mesh does not support triangulation, so use the ObjLoader.loadObj * methods to load the mesh into the Alias ββWavefront OBJ . Specifying geometry should not be a problem; The article refers to some sample files.
Source: https://habr.com/ru/post/915481/More articles:Solr returns only one sort for Component Component - autocompleteDoes the Application_Start event in global.asax fire when the code is republished? - asp.netThe threshold frequency does not work when checking spelling in Solr - solrSQL: saving a MIME type or extension? - c #https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/915480/how-can-a-remote-service-send-messages-to-a-bound-activity&usg=ALkJrhjkBCqCGMCyAVYPy-Uko1FNPlmcRQPHP - switch state - mathjavafx 2.0 add border to label - javaUITableView cellForRowAtIndexPath called more than once for each row - iosWinform App - Interaction with a web page - htmltoJSON on Backbone.Collection # where? - backbone.jsAll Articles